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
#num_nodes, #return_sequences, #stateful
Attributes inherited from Connection
#bias_initializer, #l1_lambda, #l2_lambda, #weight_initializer
Attributes inherited from HasParamLayer
Attributes inherited from Layer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: RandomNormal.new, bias_initializer: Zeros.new, l1_lambda: 0, l2_lambda: 0, use_bias: true) ⇒ GRU
constructor
A new instance of GRU.
Methods inherited from RNN
#backward, #forward, #output_shape, #regularizers, #reset_state, #to_hash
Methods inherited from Connection
#regularizers, #to_hash, #use_bias
Methods inherited from HasParamLayer
Methods inherited from Layer
#backward, #build, #built?, #forward, #output_shape, #to_hash
Constructor Details
#initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: RandomNormal.new, bias_initializer: Zeros.new, l1_lambda: 0, l2_lambda: 0, use_bias: true) ⇒ GRU
Returns a new instance of GRU.
410 411 412 413 414 415 416 417 418 419 |
# File 'lib/dnn/core/rnn_layers.rb', line 410 def initialize(num_nodes, stateful: false, return_sequences: true, weight_initializer: RandomNormal.new, bias_initializer: Zeros.new, l1_lambda: 0, l2_lambda: 0, use_bias: true) super end |
Class Method Details
.load_hash(hash) ⇒ Object
398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/dnn/core/rnn_layers.rb', line 398 def self.load_hash(hash) gru = self.new(hash[:num_nodes], stateful: hash[:stateful], return_sequences: hash[:return_sequences], weight_initializer: Utils.load_hash(hash[:weight_initializer]), bias_initializer: Utils.load_hash(hash[:bias_initializer]), l1_lambda: hash[:l1_lambda], l2_lambda: hash[:l2_lambda], use_bias: hash[:use_bias]) gru end |