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: nil, bias_initializer: nil, l1_lambda: 0, l2_lambda: 0) ⇒ GRU
constructor
A new instance of GRU.
Methods inherited from RNN
#backward, #dlasso, #dlasso2, #dridge, #dridge2, #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: nil, bias_initializer: nil, l1_lambda: 0, l2_lambda: 0) ⇒ GRU
Returns a new instance of GRU.
429 430 431 432 433 434 435 436 437 |
# File 'lib/dnn/core/rnn_layers.rb', line 429 def initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: nil, bias_initializer: nil, l1_lambda: 0, l2_lambda: 0) super end |
Class Method Details
.load_hash(hash) ⇒ Object
418 419 420 421 422 423 424 425 426 427 |
# File 'lib/dnn/core/rnn_layers.rb', line 418 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 |