class DNN::Layers::Mul
Public Instance Methods
backward_node(dy)
click to toggle source
# File lib/dnn/core/layers/math_layers.rb, line 103 def backward_node(dy) dx1 = MathUtils.sum_to(dy * @x2, @x1.shape) dx2 = MathUtils.sum_to(dy * @x1, @x2.shape) [dx1, dx2] end
forward_node(x1, x2)
click to toggle source
# File lib/dnn/core/layers/math_layers.rb, line 98 def forward_node(x1, x2) @x1, @x2 = x1, x2 x1 * x2 end