class DNN::Layers::Pow
Public Class Methods
new(index)
click to toggle source
Calls superclass method
DNN::Layers::Layer::new
# File lib/dnn/core/layers/math_layers.rb, line 166 def initialize(index) super() @index = index end
Public Instance Methods
backward_node(dy)
click to toggle source
# File lib/dnn/core/layers/math_layers.rb, line 176 def backward_node(dy) dy * @index * @x**(@index - 1) end
forward_node(x)
click to toggle source
# File lib/dnn/core/layers/math_layers.rb, line 171 def forward_node(x) @x = x x**@index end