Class: DNN::Layers::Exp

Inherits:
Layer
  • Object
show all
Includes:
LayerNode
Defined in:
lib/dnn/core/layers/math_layers.rb

Instance Attribute Summary

Attributes inherited from Layer

#input_shape, #output_shape

Instance Method Summary collapse

Methods included from LayerNode

#forward

Methods inherited from Layer

#<<, #build, #built?, #call, call, #clean, #compute_output_shape, #forward, from_hash, #initialize, #load_hash, #to_hash

Constructor Details

This class inherits a constructor from DNN::Layers::Layer

Instance Method Details

#backward_node(dy) ⇒ Object



145
146
147
# File 'lib/dnn/core/layers/math_layers.rb', line 145

def backward_node(dy)
  dy * @y
end

#forward_node(x) ⇒ Object



141
142
143
# File 'lib/dnn/core/layers/math_layers.rb', line 141

def forward_node(x)
  @y = Xumo::NMath.exp(x)
end