Class: DNN::Layers::Flatten

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

Instance Attribute Summary

Attributes inherited from Layer

#input_shape, #output_shape

Instance Method Summary collapse

Methods inherited from Layer

#<<, #build, #built?, #call, call, #clean, from_hash, #initialize, #load_hash, #to_hash

Constructor Details

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

Instance Method Details

#compute_output_shapeObject



300
301
302
# File 'lib/dnn/core/layers/basic_layers.rb', line 300

def compute_output_shape
  [@input_shape.reduce(:*)]
end

#forward(x) ⇒ Object



296
297
298
# File 'lib/dnn/core/layers/basic_layers.rb', line 296

def forward(x)
  Reshape.(x, @output_shape)
end