Class: DNN::MergeLayers::Add

Inherits:
MergeLayer show all
Defined in:
lib/dnn/core/merge_layers.rb

Instance Attribute Summary

Attributes inherited from Layers::Layer

#input_shape, #name

Instance Method Summary collapse

Methods inherited from MergeLayer

call, #call

Methods inherited from Layers::Layer

#build, #built?, call, #call, from_hash, #initialize, #load_hash, #output_shape, #to_hash

Constructor Details

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

Instance Method Details

#backward(dy) ⇒ Object



25
26
27
# File 'lib/dnn/core/merge_layers.rb', line 25

def backward(dy)
  [dy, dy]
end

#forward(x1, x2) ⇒ Object



21
22
23
# File 'lib/dnn/core/merge_layers.rb', line 21

def forward(x1, x2)
  x1 + x2
end