updateParameter¶
-
ConvolutionalLayer.
updateParameter
()¶ パラメータの更新
ソース¶
updateParameter() {
var lap = new Lap(this.updateTime);
var prev_layer = this.prevLayer;
var eta = net.learningRate / miniBatchSize;
var weight_idx = 0;
// 出力のチャネルに対し
for (var channel_idx = 0; channel_idx < this.numChannels; channel_idx++) {
this.bias.dt[channel_idx] -= eta * this.deltaBias.dt[channel_idx];
// 入力のチャネルに対し
for(var prev_channel_idx = 0; prev_channel_idx < prev_layer.numChannels; prev_channel_idx++){
// フィルターの行に対し
for (var r2 = 0; r2 < this.filterSize; r2++) {
// フィルターの列に対し
for (var c2 = 0; c2 < this.filterSize; c2++) {
this.weight.dt[weight_idx] -= ( eta * this.deltaWeight.dt[weight_idx] + net.learningRate *
L2lambda * this.weight.dt[weight_idx]);
weight_idx++;
}
}
}
}
Assert(weight_idx == this.weight.dt.length);
lap.Time();
}