forwardCost ====================== .. js:function:: NeuralNetwork.forwardCost(batch_Y, exp_work, batch_idx, layer_idx, last_delta_y_dt) 順伝播と損失関数の計算 :param float[] batch_Y: 正解の出力 :param float[] exp_work: 作業用データ :param int batch_idx: ミニバッチ内のインデックス :param int layer_idx: レイヤーのインデックス :param float[] last_delta_y_dt: 最後のレイヤーのδy ソース ^^^^^^ .. code-block:: js 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); }