Class: DNN::Layers::HasParamLayer

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

Overview

This class is a superclass of all classes with learning parameters.

Direct Known Subclasses

BatchNormalization, Connection, Embedding

Instance Attribute Summary collapse

Attributes inherited from Layer

#input_shape, #name

Instance Method Summary collapse

Methods inherited from Layer

#backward, #build, #built?, #call, call, #forward, from_hash, #load_hash, #output_shape, #to_hash

Constructor Details

#initializeHasParamLayer



88
89
90
91
# File 'lib/dnn/core/layers.rb', line 88

def initialize
  super()
  @trainable = true
end

Instance Attribute Details

#trainableBoolean



86
87
88
# File 'lib/dnn/core/layers.rb', line 86

def trainable
  @trainable
end

Instance Method Details

#get_paramsArray

Returns The parameters of the layer.

Raises:

  • (NotImplementedError)


94
95
96
# File 'lib/dnn/core/layers.rb', line 94

def get_params
  raise NotImplementedError, "Class '#{self.class.name}' has implement method 'get_params'"
end