forwardCost

NeuralNetwork.forwardCost(batch_Y, exp_work, batch_idx, layer_idx, last_delta_y_dt)

順伝播と損失関数の計算

引数:
  • batch_Y (float[]) – 正解の出力
  • exp_work (float[]) – 作業用データ
  • batch_idx (int) – ミニバッチ内のインデックス
  • layer_idx (int) – レイヤーのインデックス
  • last_delta_y_dt (float[]) – 最後のレイヤーのδy

ソース

forwardCost(batch_Y, exp_work, batch_idx, layer_idx, last_delta_y_dt) {
    var last_layer = this.layers[this.layers.length - 1];

    for(; layer_idx < this.layers.length; layer_idx++){
        this.layers[layer_idx].forward();
    }

    return this.SoftMax(last_delta_y_dt, last_layer.y_.dt, batch_Y, exp_work, last_layer.unitSize, batch_idx);
}