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