Class: Chainer::Functions::Math::PowVarConst
Instance Attribute Summary
#inputs, #outputs, #rank
Instance Method Summary
collapse
#apply, #backward_accumulate, #forward_cpu, #get_retained_inputs, #get_retained_outputs, #label, #output_data, #retain_inputs, #retain_outputs, #unchain
Constructor Details
109
110
111
|
# File 'lib/chainer/functions/math/basic_math.rb', line 109
def initialize(value)
@value = value
end
|
Instance Method Details
#backward(x, gy) ⇒ Object
117
118
119
120
121
|
# File 'lib/chainer/functions/math/basic_math.rb', line 117
def backward(x, gy)
val_1 = @value - 1
gx = @value * (x[0] ** val_1) * gy[0]
[Utils::Array.force_array(gx)]
end
|
#forward(x) ⇒ Object
113
114
115
|
# File 'lib/chainer/functions/math/basic_math.rb', line 113
def forward(x)
[Utils::Array.force_array(x[0] ** @value)]
end
|