Class: DNN::Layers::GRU
- Inherits:
-
RNN
- Object
- Layer
- HasParamLayer
- Connection
- RNN
- DNN::Layers::GRU
- Defined in:
- lib/dnn/core/rnn_layers.rb
Instance Attribute Summary
Attributes inherited from RNN
#bias, #num_nodes, #stateful, #weight, #weight2
Attributes inherited from Connection
Attributes inherited from HasParamLayer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: Initializers::RandomNormal.new, bias_initializer: Initializers::Zeros.new, l1_lambda: 0, l2_lambda: 0) ⇒ GRU
constructor
A new instance of GRU.
Methods inherited from RNN
#backward, #dlasso, #dridge, #forward, #lasso, #reset_state, #ridge, #shape, #to_hash
Methods inherited from Connection
#dlasso, #dridge, #lasso, #ridge, #to_hash
Methods inherited from HasParamLayer
Methods inherited from Layer
#backward, #build, #built?, #forward, #prev_layer, #shape, #to_hash
Constructor Details
#initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: Initializers::RandomNormal.new, bias_initializer: Initializers::Zeros.new, l1_lambda: 0, l2_lambda: 0) ⇒ GRU
Returns a new instance of GRU.
412 413 414 415 416 417 418 419 420 |
# File 'lib/dnn/core/rnn_layers.rb', line 412 def initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: Initializers::RandomNormal.new, bias_initializer: Initializers::Zeros.new, l1_lambda: 0, l2_lambda: 0) super end |
Class Method Details
.load_hash(hash) ⇒ Object
401 402 403 404 405 406 407 408 409 410 |
# File 'lib/dnn/core/rnn_layers.rb', line 401 def self.load_hash(hash) gru = self.new(hash[:num_nodes], stateful: hash[:stateful], return_sequences: hash[:return_sequences], weight_initializer: Util.load_hash(hash[:weight_initializer]), bias_initializer: Util.load_hash(hash[:bias_initializer]), l1_lambda: hash[:l1_lambda], l2_lambda: hash[:l2_lambda]) gru end |