Class: DNN::Layers::Dot
- Inherits:
-
MergeLayer
- Object
- Layer
- MergeLayer
- DNN::Layers::Dot
- Includes:
- MergeLayerNode
- Defined in:
- lib/dnn/core/layers/math_layers.rb
Instance Attribute Summary
Attributes inherited from Layer
Instance Method Summary collapse
Methods included from MergeLayerNode
Methods inherited from MergeLayer
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
131 132 133 |
# File 'lib/dnn/core/layers/math_layers.rb', line 131 def backward_node(dy) [dy.dot(@x2.transpose), @x1.transpose.dot(dy)] end |
#forward_node(x1, x2) ⇒ Object
126 127 128 129 |
# File 'lib/dnn/core/layers/math_layers.rb', line 126 def forward_node(x1, x2) @x1, @x2 = x1, x2 x1.dot(x2) end |