gpuDeltaWeight ============================ .. js:function:: FullyConnectedLayer.gpuDeltaWeight() GPUによるδweightの計算 .. math:: \delta weight_{i,j} = \delta z_{i} \cdot x_{j} ソース ^^^^^^ .. code-block:: js gpuDeltaWeight(){ var vertex_shader = Shaders.FullyConnectedLayer_DeltaWeight; var prev_layer = this.prevLayer; var vertex_shader = vertex_shader .replace(/miniBatchSize/g, miniBatchSize.toString()) .replace(/WeightColSize/g, prev_layer.unitSize.toString()); var param_id = "Fully-Connected-Layer-delta-weight," + miniBatchSize + "," + prev_layer.unitSize + "," + this.unitSize; if (this.params[param_id] == undefined){ this.params[param_id] = { id : param_id, vertexShader: vertex_shader, args : { "zero": new Float32Array(this.deltaWeight.dt.length), "prev_y": makeTextureInfo(WebGL2, "float", new ArrayView(miniBatchSize, prev_layer.unitSize)), "deltaZ": makeTextureInfo(WebGL2, "float", this.deltaZ), "deltaWeight" : this.deltaWeight.dt } }; } var param = this.params[param_id]; param.args["prev_y"].value = prev_layer.y_.dt;; param.args["deltaZ"].value = this.deltaZ.dt; param.args["deltaWeight"].value = this.deltaWeight.dt; WebGL2.compute(param); }