Module: DNN::Layers::LayerNode
- Included in:
- AvgPool2D, BatchNormalization, Conv2D, Conv2DTranspose, Dense, Dropout, ELU, Embedding, Exp, Flatten, Lasso, LeakyReLU, Log, MaxPool2D, Mean, Mish, Neg, Pow, RNN, ReLU, Reshape, Ridge, Sigmoid, Softplus, Softsign, Sqrt, Sum, Swish, Tanh, UnPool2D
- Defined in:
- lib/dnn/core/layers/basic_layers.rb
Instance Method Summary collapse
Instance Method Details
#backward_node(dy) ⇒ Object
17 18 19 |
# File 'lib/dnn/core/layers/basic_layers.rb', line 17 def backward_node(dy) raise NotImplementedError, "Class '#{self.class.name}' has implement method 'backward_node'" end |
#forward(input) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/dnn/core/layers/basic_layers.rb', line 5 def forward(input) x = input.data prev = (input.is_a?(Tensor) ? input.link : input) y = forward_node(x) link = Link.new(prev, self) Tensor.new(y, link) end |
#forward_node(x) ⇒ Object
13 14 15 |
# File 'lib/dnn/core/layers/basic_layers.rb', line 13 def forward_node(x) raise NotImplementedError, "Class '#{self.class.name}' has implement method 'forward_node'" end |