class Chainer::Functions::Math::Exp

Public Class Methods

exp(x) click to toggle source

Elementwise exponential function.

# File lib/chainer/functions/math/exp.rb, line 6
def self.exp(x)
  self.new.apply([x]).first
end

Public Instance Methods

backward(indexes, gy) click to toggle source
# File lib/chainer/functions/math/exp.rb, line 21
def backward(indexes, gy)
  y = get_retained_outputs.first
  [y * gy.first]
end
forward(x) click to toggle source
# File lib/chainer/functions/math/exp.rb, line 14
def forward(x)
  retain_inputs([])
  retain_outputs([0])
  xm = Chainer.get_array_module(x.first)
  [Utils::Array.force_array(xm::NMath.exp(x.first))]
end
label() click to toggle source
# File lib/chainer/functions/math/exp.rb, line 10
def label
  'exp'
end