Class: DNN::Layers::Layer

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

Overview

Super class of all optimizer classes.

Instance Method Summary collapse

Instance Method Details

#backwardObject

Backward propagation.



17
# File 'lib/dnn/core/layers.rb', line 17

def backward() end

#forwardObject

Forward propagation.



14
# File 'lib/dnn/core/layers.rb', line 14

def forward() end

#init(model) ⇒ Object

Initialize layer when model is compiled.



9
10
11
# File 'lib/dnn/core/layers.rb', line 9

def init(model)
  @model = model
end

#prev_layerObject

Get the previous layer.



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

def prev_layer
  @model.layers[@model.layers.index(self) - 1]
end

#shapeObject

Get the shape of the layer.



20
21
22
# File 'lib/dnn/core/layers.rb', line 20

def shape
  prev_layer.shape
end