Class: DNN::Layers::OutputLayer

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

Instance Method Summary collapse

Methods inherited from Layer

#backward, #build, #built?, #forward, #initialize, #prev_layer, #shape, #to_hash

Constructor Details

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

Instance Method Details

#dloss ⇒ Object



277
278
279
280
281
282
# File 'lib/dnn/core/layers.rb', line 277

def dloss
  @model.get_all_layers.select { |layer| layer.is_a?(Connection) }.each do |layer|
    layer.dlasso
    layer.dridge
  end
end

#loss(x) ⇒ Object

Classes that inherit from this class must implement this method.

Raises:

  • (NotImplementedError)


273
274
275
# File 'lib/dnn/core/layers.rb', line 273

def loss(x)
  raise NotImplementedError.new("Class '#{self.class.name}' has implement method 'forward'")
end