Class: DNN::Layers::InputLayer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Layer

#init, #prev_layer

Constructor Details

#initialize(dim_or_shape) ⇒ InputLayer

Returns a new instance of InputLayer.



60
61
62
# File 'lib/dnn/core/layers.rb', line 60

def initialize(dim_or_shape)
  @shape = dim_or_shape.is_a?(Array) ? dim_or_shape : [dim_or_shape]
end

Instance Attribute Details

#shapeObject (readonly)

Returns the value of attribute shape.



58
59
60
# File 'lib/dnn/core/layers.rb', line 58

def shape
  @shape
end

Instance Method Details

#backward(dout) ⇒ Object



68
69
70
# File 'lib/dnn/core/layers.rb', line 68

def backward(dout)
  dout
end

#forward(x) ⇒ Object



64
65
66
# File 'lib/dnn/core/layers.rb', line 64

def forward(x)
  x
end