Class: DNN::Layers::ReLU
- Includes:
- LayerNode
- Defined in:
- lib/dnn/core/layers/activations.rb
Instance Attribute Summary
Attributes inherited from Layer
Instance Method Summary collapse
Methods included from LayerNode
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
75 76 77 |
# File 'lib/dnn/core/layers/activations.rb', line 75 def backward_node(dy) dy * Xumo::SFloat.cast(@x > 0) end |
#forward_node(x) ⇒ Object
70 71 72 73 |
# File 'lib/dnn/core/layers/activations.rb', line 70 def forward_node(x) @x = x Xumo::SFloat.maximum(0, x) end |