LongShortTermMemoryLayer Class Reference

#include <long_short_term_memory_layer.h>

Inheritance diagram for LongShortTermMemoryLayer:
Layer

Public Types

enum class  ActivationFunction {
  Threshold , SymmetricThreshold , Logistic , HyperbolicTangent ,
  Linear , RectifiedLinear , ExponentialLinear , ScaledExponentialLinear ,
  SoftPlus , SoftSign , HardSigmoid
}
 Enumeration of available activation functions for the long-short term memory layer. More...
 
- Public Types inherited from Layer
enum class  Type {
  Scaling , Convolutional , Perceptron , Pooling ,
  Probabilistic , LongShortTermMemory , Recurrent , Unscaling ,
  Bounding
}
 This enumeration represents the possible types of layers. More...
 

Public Member Functions

 LongShortTermMemoryLayer ()
 
 LongShortTermMemoryLayer (const Index &, const Index &)
 
virtual ~LongShortTermMemoryLayer ()
 
bool is_empty () const
 
Index get_inputs_number () const
 Returns the number of inputs to the layer. More...
 
Index get_neurons_number () const
 Returns the size of the neurons vector. More...
 
Tensor< type, 1 > get_input_biases () const
 
Tensor< type, 1 > get_forget_biases () const
 
Tensor< type, 1 > get_state_biases () const
 
Tensor< type, 1 > get_output_biases () const
 
Tensor< type, 2 > get_input_weights () const
 
Tensor< type, 2 > get_forget_weights () const
 
Tensor< type, 2 > get_state_weights () const
 
Tensor< type, 2 > get_output_weights () const
 
Tensor< type, 2 > get_input_recurrent_weights () const
 
Tensor< type, 2 > get_forget_recurrent_weights () const
 
Tensor< type, 2 > get_state_recurrent_weights () const
 
Tensor< type, 2 > get_output_recurrent_weights () const
 
Index get_timesteps () const
 Returns the number of timesteps. More...
 
Index get_parameters_number () const
 Returns the number of parameters (biases, weights, recurrent weights) of the layer. More...
 
Tensor< type, 1 > get_parameters () const
 
const LongShortTermMemoryLayer::ActivationFunctionget_activation_function () const
 Returns the activation function of the layer. More...
 
const LongShortTermMemoryLayer::ActivationFunctionget_recurrent_activation_function () const
 Returns the recurrent activation function of the layer. More...
 
string write_activation_function () const
 
string write_recurrent_activation_function () const
 
const bool & get_display () const
 
void set ()
 
void set (const Index &, const Index &)
 
void set (const LongShortTermMemoryLayer &)
 
void set_default ()
 
void set_name (const string &)
 
void set_inputs_number (const Index &)
 
void set_neurons_number (const Index &)
 
void set_input_shape (const Tensor< Index, 1 > &)
 
void set_input_biases (const Tensor< type, 1 > &)
 
void set_forget_biases (const Tensor< type, 1 > &)
 
void set_state_biases (const Tensor< type, 1 > &)
 
void set_output_biases (const Tensor< type, 1 > &)
 
void set_input_weights (const Tensor< type, 2 > &)
 
void set_forget_weights (const Tensor< type, 2 > &)
 
void set_state_weights (const Tensor< type, 2 > &)
 
void set_output_weights (const Tensor< type, 2 > &)
 
void set_input_recurrent_weights (const Tensor< type, 2 > &)
 
void set_forget_recurrent_weights (const Tensor< type, 2 > &)
 
void set_state_recurrent_weights (const Tensor< type, 2 > &)
 
void set_output_recurrent_weights (const Tensor< type, 2 > &)
 
void set_parameters (const Tensor< type, 1 > &, const Index &=0)
 
void set_activation_function (const ActivationFunction &)
 
void set_activation_function (const string &)
 
void set_recurrent_activation_function (const ActivationFunction &)
 
void set_recurrent_activation_function (const string &)
 
void set_timesteps (const Index &)
 
void set_display (const bool &)
 
void set_biases_constant (const type &)
 
void set_forget_biases_constant (const type &)
 
void set_input_biases_constant (const type &)
 
void set_state_biases_constant (const type &)
 
void set_output_biases_constant (const type &)
 
void set_weights_constant (const type &)
 
void set_forget_weights_constant (const type &)
 
void set_input_weights_constant (const type &)
 
void set_state_weights_constant (const type &)
 
void set_output_weights_constant (const type &)
 
void set_recurrent_weights_constant (const type &)
 
void set_forget_recurrent_weights_constant (const type &)
 
void set_input_recurrent_weights_constant (const type &)
 
void set_state_recurrent_weights_constant (const type &)
 
void set_output_recurrent_weights_constant (const type &)
 
void set_hidden_states_constant (const type &)
 
void set_cell_states_constant (const type &)
 
void set_parameters_constant (const type &)
 
void set_parameters_random ()
 
void calculate_combinations (const Tensor< type, 1 > &, const Tensor< type, 2 > &, const Tensor< type, 2 > &, const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void calculate_activations (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void calculate_activations (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
Tensor< type, 1 > calculate_activations (const Tensor< type, 1 > &) const
 
void calculate_recurrent_activations (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void calculate_recurrent_activations (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void calculate_activations_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void calculate_activations_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void calculate_recurrent_activations_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
Tensor< type, 2 > calculate_outputs (const Tensor< type, 2 > &)
 
void calculate_hidden_delta (LayerForwardPropagation *, LayerBackPropagation *, LayerBackPropagation *) const
 
void calculate_hidden_delta_perceptron (PerceptronLayerForwardPropagation *, PerceptronLayerBackPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_hidden_delta_probabilistic (ProbabilisticLayerForwardPropagation *, ProbabilisticLayerBackPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void forward_propagate (const Tensor< type, 2 > &, LayerForwardPropagation *)
 
void forward_propagate (const Tensor< type, 2 > &, Tensor< type, 1 >, LayerForwardPropagation *)
 
void insert_gradient (LayerBackPropagation *, const Index &, Tensor< type, 1 > &) const
 
void calculate_error_gradient (const Tensor< type, 2 > &, LayerForwardPropagation *, LayerBackPropagation *) const
 
void calculate_forget_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_input_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_state_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_output_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_forget_recurrent_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_input_recurrent_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_state_recurrent_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_output_recurrent_weights_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_forget_biases_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_input_biases_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_state_biases_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
void calculate_output_biases_error_gradient (const Tensor< type, 2 > &, LongShortTermMemoryLayerForwardPropagation *, LongShortTermMemoryLayerBackPropagation *) const
 
string write_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const
 
string write_recurrent_activation_function_expression () const
 
string write_activation_function_expression () const
 
string write_expression_c () const
 
string write_combinations_c () const
 
string write_expression_python () const
 
string write_combinations_python () const
 
void from_XML (const tinyxml2::XMLDocument &)
 
void write_XML (tinyxml2::XMLPrinter &) const
 
- Public Member Functions inherited from Layer
string get_name () const
 
void set_threads_number (const int &)
 
virtual Tensor< type, 2 > calculate_outputs_from4D (const Tensor< type, 4 > &)
 
virtual Tensor< type, 4 > calculate_outputs_4D (const Tensor< type, 4 > &)
 
virtual void forward_propagate (const Tensor< type, 4 > &, LayerForwardPropagation *)
 
virtual void forward_propagate (const Tensor< type, 4 > &, Tensor< type, 1 >, LayerForwardPropagation *)
 
virtual void calculate_hidden_delta_lm (LayerForwardPropagation *, LayerBackPropagationLM *, LayerBackPropagationLM *) const
 
virtual void calculate_error_gradient (const Tensor< type, 4 > &, LayerForwardPropagation *, LayerBackPropagation *) const
 
virtual void calculate_squared_errors_Jacobian_lm (const Tensor< type, 2 > &, LayerForwardPropagation *, LayerBackPropagationLM *)
 
virtual void insert_squared_errors_Jacobian_lm (LayerBackPropagationLM *, const Index &, Tensor< type, 2 > &) const
 
virtual Index get_synaptic_weights_number () const
 Returns the number of layer's synaptic weights. More...
 
Type get_type () const
 
string get_type_string () const
 Takes the type of layer used by the model. More...
 

Protected Attributes

Index timesteps = 3
 
Tensor< type, 1 > input_biases
 
Tensor< type, 1 > forget_biases
 
Tensor< type, 1 > state_biases
 
Tensor< type, 1 > output_biases
 
Tensor< type, 2 > input_weights
 
Tensor< type, 2 > forget_weights
 
Tensor< type, 2 > state_weights
 
Tensor< type, 2 > output_weights
 
Tensor< type, 2 > forget_recurrent_weights
 
Tensor< type, 2 > input_recurrent_weights
 
Tensor< type, 2 > state_recurrent_weights
 
Tensor< type, 2 > output_recurrent_weights
 
ActivationFunction activation_function = ActivationFunction::HyperbolicTangent
 Activation function variable. More...
 
ActivationFunction recurrent_activation_function = ActivationFunction::HardSigmoid
 
Index batch
 
Index variables
 
Tensor< type, 1 > hidden_states
 
Tensor< type, 1 > cell_states
 
bool display = true
 Display messages to screen. More...
 
- Protected Attributes inherited from Layer
NonBlockingThreadPool * non_blocking_thread_pool = nullptr
 
ThreadPoolDevice * thread_pool_device = nullptr
 
string layer_name = "layer"
 Layer name. More...
 
Type layer_type = Type::Perceptron
 Layer type. More...
 
const Eigen::array< IndexPair< Index >, 1 > A_BT = {IndexPair<Index>(1, 1)}
 
const Eigen::array< IndexPair< Index >, 1 > AT_B = {IndexPair<Index>(0, 0)}
 
const Eigen::array< IndexPair< Index >, 1 > A_B = {IndexPair<Index>(1, 0)}
 

Additional Inherited Members

- Protected Member Functions inherited from Layer
void hard_sigmoid (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void hyperbolic_tangent (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void logistic (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void linear (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void threshold (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void symmetric_threshold (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void rectified_linear (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void scaled_exponential_linear (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void soft_plus (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void soft_sign (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void exponential_linear (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void softmax (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void binary (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void competitive (const Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void hard_sigmoid_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void hyperbolic_tangent_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void linear_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void logistic_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void threshold_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void symmetric_threshold_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void rectified_linear_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void scaled_exponential_linear_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void soft_plus_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void soft_sign_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void exponential_linear_derivatives (const Tensor< type, 1 > &, Tensor< type, 1 > &, Tensor< type, 1 > &) const
 
void hard_sigmoid (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void hyperbolic_tangent (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void logistic (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void linear (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void threshold (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void symmetric_threshold (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void rectified_linear (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void scaled_exponential_linear (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void soft_plus (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void soft_sign (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void exponential_linear (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void softmax (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void binary (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void competitive (const Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void hard_sigmoid_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void hyperbolic_tangent_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void linear_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void logistic_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void threshold_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void symmetric_threshold_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void rectified_linear_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void scaled_exponential_linear_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void soft_plus_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void soft_sign_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void exponential_linear_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const
 
void logistic_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 3 > &) const
 
void softmax_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 3 > &) const
 
void linear (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void logistic (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void hyperbolic_tangent (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void threshold (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void symmetric_threshold (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void rectified_linear (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void scaled_exponential_linear (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void soft_plus (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void soft_sign (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void hard_sigmoid (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void exponential_linear (const Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void linear_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void logistic_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void hyperbolic_tangent_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void threshold_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void symmetric_threshold_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void rectified_linear_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void scaled_exponential_linear_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void soft_plus_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void soft_sign_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void hard_sigmoid_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 
void exponential_linear_derivatives (const Tensor< type, 4 > &, Tensor< type, 4 > &, Tensor< type, 4 > &) const
 

Detailed Description

This class represents a layer of neurons. Layers of neurons will be used to construct multilayer neurons.

Definition at line 40 of file long_short_term_memory_layer.h.

Member Enumeration Documentation

◆ ActivationFunction

enum class ActivationFunction
strong

Enumeration of available activation functions for the long-short term memory layer.

Definition at line 47 of file long_short_term_memory_layer.h.

Constructor & Destructor Documentation

◆ LongShortTermMemoryLayer() [1/2]

Default constructor. It creates a empty layer object, with no neurons. This constructor also initializes the rest of class members to their default values.

Definition at line 20 of file long_short_term_memory_layer.cpp.

◆ LongShortTermMemoryLayer() [2/2]

LongShortTermMemoryLayer ( const Index &  new_inputs_number,
const Index &  new_neurons_number 
)
explicit

Layer architecture constructor. It creates a layer object with given numbers of inputs and neurons. The parameters are initialized at random. This constructor also initializes the rest of class members to their default values.

Parameters
new_inputs_numberNumber of inputs in the layer.
new_neurons_numberNumber of neurons in the layer.

Definition at line 35 of file long_short_term_memory_layer.cpp.

◆ ~LongShortTermMemoryLayer()

Destructor. This destructor does not delete any pointer.

Definition at line 46 of file long_short_term_memory_layer.cpp.

Member Function Documentation

◆ calculate_activations() [1/3]

Tensor< type, 1 > calculate_activations ( const Tensor< type, 1 > &  combinations_1d) const

Definition at line 1271 of file long_short_term_memory_layer.cpp.

◆ calculate_activations() [2/3]

void calculate_activations ( const Tensor< type, 1 > &  combinations_1d,
Tensor< type, 1 > &  activations_1d 
) const

Definition at line 1223 of file long_short_term_memory_layer.cpp.

◆ calculate_activations() [3/3]

void calculate_activations ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations 
) const

Definition at line 1189 of file long_short_term_memory_layer.cpp.

◆ calculate_activations_derivatives() [1/2]

void calculate_activations_derivatives ( const Tensor< type, 1 > &  combinations_1d,
Tensor< type, 1 > &  activations_1d,
Tensor< type, 1 > &  activations_derivatives_1d 
) const

Definition at line 1472 of file long_short_term_memory_layer.cpp.

◆ calculate_activations_derivatives() [2/2]

void calculate_activations_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives_2d 
) const

Definition at line 1422 of file long_short_term_memory_layer.cpp.

◆ calculate_combinations()

void calculate_combinations ( const Tensor< type, 1 > &  inputs,
const Tensor< type, 2 > &  weights,
const Tensor< type, 2 > &  recurrent_weights,
const Tensor< type, 1 > &  biases,
Tensor< type, 1 > &  combinations 
) const

Definition at line 1171 of file long_short_term_memory_layer.cpp.

◆ calculate_error_gradient()

void calculate_error_gradient ( const Tensor< type, 2 > &  inputs,
LayerForwardPropagation forward_propagation,
LayerBackPropagation back_propagation 
) const
virtual

Reimplemented from Layer.

Definition at line 2110 of file long_short_term_memory_layer.cpp.

◆ calculate_forget_biases_error_gradient()

void calculate_forget_biases_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 3279 of file long_short_term_memory_layer.cpp.

◆ calculate_forget_recurrent_weights_error_gradient()

void calculate_forget_recurrent_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 2789 of file long_short_term_memory_layer.cpp.

◆ calculate_forget_weights_error_gradient()

void calculate_forget_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 2179 of file long_short_term_memory_layer.cpp.

◆ calculate_hidden_delta()

void calculate_hidden_delta ( LayerForwardPropagation next_forward_propagation,
LayerBackPropagation next_back_propagation,
LayerBackPropagation back_propagation 
) const
virtual

Reimplemented from Layer.

Definition at line 1648 of file long_short_term_memory_layer.cpp.

◆ calculate_hidden_delta_perceptron()

void calculate_hidden_delta_perceptron ( PerceptronLayerForwardPropagation next_forward_propagation,
PerceptronLayerBackPropagation next_back_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 1690 of file long_short_term_memory_layer.cpp.

◆ calculate_hidden_delta_probabilistic()

void calculate_hidden_delta_probabilistic ( ProbabilisticLayerForwardPropagation next_forward_propagation,
ProbabilisticLayerBackPropagation next_back_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 1701 of file long_short_term_memory_layer.cpp.

◆ calculate_input_biases_error_gradient()

void calculate_input_biases_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 3419 of file long_short_term_memory_layer.cpp.

◆ calculate_input_recurrent_weights_error_gradient()

void calculate_input_recurrent_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 2918 of file long_short_term_memory_layer.cpp.

◆ calculate_input_weights_error_gradient()

void calculate_input_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 2343 of file long_short_term_memory_layer.cpp.

◆ calculate_output_biases_error_gradient()

void calculate_output_biases_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 3695 of file long_short_term_memory_layer.cpp.

◆ calculate_output_recurrent_weights_error_gradient()

void calculate_output_recurrent_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 3160 of file long_short_term_memory_layer.cpp.

◆ calculate_output_weights_error_gradient()

void calculate_output_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 2650 of file long_short_term_memory_layer.cpp.

◆ calculate_outputs()

Tensor< type, 2 > calculate_outputs ( const Tensor< type, 2 > &  inputs)
virtual

Reimplemented from Layer.

Definition at line 1573 of file long_short_term_memory_layer.cpp.

◆ calculate_recurrent_activations() [1/2]

void calculate_recurrent_activations ( const Tensor< type, 1 > &  combinations_1d,
Tensor< type, 1 > &  recurrent_activations_1d 
) const

Definition at line 1372 of file long_short_term_memory_layer.cpp.

◆ calculate_recurrent_activations() [2/2]

void calculate_recurrent_activations ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations 
) const

Definition at line 1323 of file long_short_term_memory_layer.cpp.

◆ calculate_recurrent_activations_derivatives()

void calculate_recurrent_activations_derivatives ( const Tensor< type, 1 > &  combinations_1d,
Tensor< type, 1 > &  activations_1d,
Tensor< type, 1 > &  activations_derivatives_1d 
) const

Definition at line 1523 of file long_short_term_memory_layer.cpp.

◆ calculate_state_biases_error_gradient()

void calculate_state_biases_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 3561 of file long_short_term_memory_layer.cpp.

◆ calculate_state_recurrent_weights_error_gradient()

void calculate_state_recurrent_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 3043 of file long_short_term_memory_layer.cpp.

◆ calculate_state_weights_error_gradient()

void calculate_state_weights_error_gradient ( const Tensor< type, 2 > &  inputs,
LongShortTermMemoryLayerForwardPropagation forward_propagation,
LongShortTermMemoryLayerBackPropagation back_propagation 
) const

Definition at line 2508 of file long_short_term_memory_layer.cpp.

◆ forward_propagate() [1/2]

void forward_propagate ( const Tensor< type, 2 > &  inputs,
LayerForwardPropagation forward_propagation 
)
virtual

Reimplemented from Layer.

Definition at line 1774 of file long_short_term_memory_layer.cpp.

◆ forward_propagate() [2/2]

void forward_propagate ( const Tensor< type, 2 > &  inputs,
Tensor< type, 1 >  parameters,
LayerForwardPropagation forward_propagation 
)
virtual

Reimplemented from Layer.

Definition at line 1906 of file long_short_term_memory_layer.cpp.

◆ from_XML()

void from_XML ( const tinyxml2::XMLDocument document)
virtual

Reimplemented from Layer.

Definition at line 4849 of file long_short_term_memory_layer.cpp.

◆ get_activation_function()

const LongShortTermMemoryLayer::ActivationFunction & get_activation_function ( ) const

Returns the activation function of the layer.

Definition at line 281 of file long_short_term_memory_layer.cpp.

◆ get_display()

const bool & get_display ( ) const

Returns true if messages from this class are to be displayed on the screen, or false if messages from this class are not to be displayed on the screen.

Definition at line 367 of file long_short_term_memory_layer.cpp.

◆ get_forget_biases()

Tensor< type, 1 > get_forget_biases ( ) const

Returns the forget biases from all the lstm in the layer. The format is a vector of real values. The size of this vector is the number of neurons in the layer.

Definition at line 82 of file long_short_term_memory_layer.cpp.

◆ get_forget_recurrent_weights()

Tensor< type, 2 > get_forget_recurrent_weights ( ) const

Returns the forget recurrent weights from the lstm. The format is a matrix of real values. The number of rows is the number of neurons in the layer. The number of columns is the number of neurons to the layer.

Definition at line 164 of file long_short_term_memory_layer.cpp.

◆ get_forget_weights()

Tensor< type, 2 > get_forget_weights ( ) const

Returns the forget weights from the lstm. The format is a matrix of real values. The number of rows is the number of inputs in the layer. The number of columns is the number of neurons to the layer.

Definition at line 122 of file long_short_term_memory_layer.cpp.

◆ get_input_biases()

Tensor< type, 1 > get_input_biases ( ) const

Returns the input biases from all the lstm in the layer. The format is a vector of real values. The size of this vector is the number of neurons in the layer.

Definition at line 92 of file long_short_term_memory_layer.cpp.

◆ get_input_recurrent_weights()

Tensor< type, 2 > get_input_recurrent_weights ( ) const

Returns the input recurrent weights from the lstm. The format is a matrix of real values. The number of rows is the number of neurons in the layer. The number of columns is the number of neurons to the layer.

Definition at line 175 of file long_short_term_memory_layer.cpp.

◆ get_input_weights()

Tensor< type, 2 > get_input_weights ( ) const

Returns the input weights from the lstm. The format is a matrix of real values. The number of rows is the number of inputs in the layer. The number of columns is the number of neurons to the layer.

Definition at line 132 of file long_short_term_memory_layer.cpp.

◆ get_inputs_number()

Index get_inputs_number ( ) const
virtual

Returns the number of inputs to the layer.

Reimplemented from Layer.

Definition at line 53 of file long_short_term_memory_layer.cpp.

◆ get_neurons_number()

Index get_neurons_number ( ) const
virtual

Returns the size of the neurons vector.

Reimplemented from Layer.

Definition at line 61 of file long_short_term_memory_layer.cpp.

◆ get_output_biases()

Tensor< type, 1 > get_output_biases ( ) const

Returns the output biases from all the lstm in the layer. The format is a vector of real values. The size of this vector is the number of neurons in the layer.

Definition at line 112 of file long_short_term_memory_layer.cpp.

◆ get_output_recurrent_weights()

Tensor< type, 2 > get_output_recurrent_weights ( ) const

Returns the output recurrent weights from the lstm. The format is a matrix of real values. The number of rows is the number of neurons in the layer. The number of columns is the number of neurons to the layer.

Definition at line 197 of file long_short_term_memory_layer.cpp.

◆ get_output_weights()

Tensor< type, 2 > get_output_weights ( ) const

Returns the output weights from the lstm. The format is a matrix of real values. The number of rows is the number of inputs in the layer. The number of columns is the number of neurons to the layer.

Definition at line 153 of file long_short_term_memory_layer.cpp.

◆ get_parameters()

Tensor< type, 1 > get_parameters ( ) const
virtual

Returns a single vector with all the layer parameters. The format is a vector of real values. The size is the number of parameters in the layer.

Reimplemented from Layer.

Definition at line 215 of file long_short_term_memory_layer.cpp.

◆ get_parameters_number()

Index get_parameters_number ( ) const
virtual

Returns the number of parameters (biases, weights, recurrent weights) of the layer.

Reimplemented from Layer.

Definition at line 69 of file long_short_term_memory_layer.cpp.

◆ get_recurrent_activation_function()

const LongShortTermMemoryLayer::ActivationFunction & get_recurrent_activation_function ( ) const

Returns the recurrent activation function of the layer.

Definition at line 289 of file long_short_term_memory_layer.cpp.

◆ get_state_biases()

Tensor< type, 1 > get_state_biases ( ) const

Returns the state biases from all the lstm in the layer. The format is a vector of real values. The size of this vector is the number of neurons in the layer.

Definition at line 102 of file long_short_term_memory_layer.cpp.

◆ get_state_recurrent_weights()

Tensor< type, 2 > get_state_recurrent_weights ( ) const

Returns the state recurrent weights from the lstm. The format is a matrix of real values. The number of rows is the number of neurons in the layer. The number of columns is the number of neurons to the layer.

Definition at line 186 of file long_short_term_memory_layer.cpp.

◆ get_state_weights()

Tensor< type, 2 > get_state_weights ( ) const

Returns the state weights from the lstm. The format is a matrix of real values. The number of rows is the number of inputs in the layer. The number of columns is the number of neurons to the layer.

Definition at line 143 of file long_short_term_memory_layer.cpp.

◆ get_timesteps()

Index get_timesteps ( ) const

Returns the number of timesteps.

Definition at line 205 of file long_short_term_memory_layer.cpp.

◆ insert_gradient()

void insert_gradient ( LayerBackPropagation back_propagation,
const Index &  index,
Tensor< type, 1 > &  gradient 
) const
virtual

Reimplemented from Layer.

Definition at line 2044 of file long_short_term_memory_layer.cpp.

◆ set() [1/3]

void set ( )

Sets an empty layer, wihtout any neuron. It also sets the rest of members to their default values.

Definition at line 376 of file long_short_term_memory_layer.cpp.

◆ set() [2/3]

void set ( const Index &  new_inputs_number,
const Index &  new_neurons_number 
)

Sets new numbers of inputs and neurons in the layer. It also sets the rest of members to their default values.

Parameters
new_inputs_numberNumber of inputs.
new_neurons_numberNumber of neurons.

Definition at line 387 of file long_short_term_memory_layer.cpp.

◆ set() [3/3]

void set ( const LongShortTermMemoryLayer other_neuron_layer)

Sets the members of this neuron layer object with those from other neuron layer object.

Parameters
other_neuron_layerLongShortTermMemoryLayer object to be copied.

Definition at line 419 of file long_short_term_memory_layer.cpp.

◆ set_activation_function() [1/2]

void set_activation_function ( const ActivationFunction new_activation_function)

This class sets a new activation(or transfer) function in a single layer.

Parameters
new_activation_functionActivation function for the layer.

Definition at line 722 of file long_short_term_memory_layer.cpp.

◆ set_activation_function() [2/2]

void set_activation_function ( const string &  new_activation_function_name)

Sets a new activation(or transfer) function in a single layer. The argument is a string containing the name of the function("Logistic", "HyperbolicTangent", "Threshold", etc).

Parameters
new_activation_functionActivation function for that layer.

Definition at line 732 of file long_short_term_memory_layer.cpp.

◆ set_biases_constant()

void set_biases_constant ( const type &  value)

Initializes the biases of all the neurons in the layer with a given value.

Parameters
valueBiases initialization value.

Definition at line 886 of file long_short_term_memory_layer.cpp.

◆ set_cell_states_constant()

void set_cell_states_constant ( const type &  value)

Initializes cell states of the layer with a given value.

Parameters
valueCell states initialization value.

Definition at line 1039 of file long_short_term_memory_layer.cpp.

◆ set_default()

void set_default ( )

Sets those members not related to the vector of neurons to their default value.

  • Display: True.
  • layer_type: neuron_Layer.
  • trainable: True.

Definition at line 436 of file long_short_term_memory_layer.cpp.

◆ set_display()

void set_display ( const bool &  new_display)

Sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.

Parameters
new_displayDisplay value.

Definition at line 877 of file long_short_term_memory_layer.cpp.

◆ set_forget_biases()

void set_forget_biases ( const Tensor< type, 1 > &  new_biases)

Sets the forget biases of all lstm in the layer from a single vector.

Parameters
new_forget_biasesNew set of forget biases in the layer.

Definition at line 488 of file long_short_term_memory_layer.cpp.

◆ set_forget_biases_constant()

void set_forget_biases_constant ( const type &  value)

Initializes the forget biases of all the neurons in the layer with a given value.

Parameters
valueForget biases initialization value.

Definition at line 898 of file long_short_term_memory_layer.cpp.

◆ set_forget_recurrent_weights()

void set_forget_recurrent_weights ( const Tensor< type, 2 > &  new_forget_recurrent_weight)

Sets the forget recurrent weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of neurons in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_forget_recurrent_weightsNew set of forget recurrent weights in that layer.

Definition at line 576 of file long_short_term_memory_layer.cpp.

◆ set_forget_recurrent_weights_constant()

void set_forget_recurrent_weights_constant ( const type &  value)

Initializes the forget recurrent weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueForget recurrent weights initialization value.

Definition at line 994 of file long_short_term_memory_layer.cpp.

◆ set_forget_weights()

void set_forget_weights ( const Tensor< type, 2 > &  new_forget_weights)

Sets the forget weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of inputs in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_forget_weightsNew set of forget weights in that layer.

Definition at line 527 of file long_short_term_memory_layer.cpp.

◆ set_forget_weights_constant()

void set_forget_weights_constant ( const type &  value)

Initializes the forget weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueForget weights initialization value.

Definition at line 946 of file long_short_term_memory_layer.cpp.

◆ set_hidden_states_constant()

void set_hidden_states_constant ( const type &  value)

Initializes hidden states of the layer with a given value.

Parameters
valueHidden states initialization value.

Definition at line 1030 of file long_short_term_memory_layer.cpp.

◆ set_input_biases()

void set_input_biases ( const Tensor< type, 1 > &  new_biases)

Sets the input biases of all lstm in the layer from a single vector.

Parameters
new_input_biasesNew set of input biases in the layer.

Definition at line 497 of file long_short_term_memory_layer.cpp.

◆ set_input_biases_constant()

void set_input_biases_constant ( const type &  value)

Initializes the input biases of all the neurons in the layer with a given value.

Parameters
valueInput biases initialization value.

Definition at line 907 of file long_short_term_memory_layer.cpp.

◆ set_input_recurrent_weights()

void set_input_recurrent_weights ( const Tensor< type, 2 > &  new_input_recurrent_weight)

Sets the input recurrent weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of neurons in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_input_recurrent_weightsNew set of input recurrent weights in that layer.

Definition at line 589 of file long_short_term_memory_layer.cpp.

◆ set_input_recurrent_weights_constant()

void set_input_recurrent_weights_constant ( const type &  value)

Initializes the input recurrent weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueInput recurrent weights initialization value.

Definition at line 1003 of file long_short_term_memory_layer.cpp.

◆ set_input_shape()

void set_input_shape ( const Tensor< Index, 1 > &  size)

Sets a new size of inputs in the layer. The new biases, weights and recurrent weights are initialized at random.

Parameters
sizedimensions of layer inputs.

Definition at line 465 of file long_short_term_memory_layer.cpp.

◆ set_input_weights()

void set_input_weights ( const Tensor< type, 2 > &  new_input_weight)

Sets the input weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of inputs in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_input_weightsNew set of input weights in that layer.

Definition at line 539 of file long_short_term_memory_layer.cpp.

◆ set_input_weights_constant()

void set_input_weights_constant ( const type &  value)

Initializes the input weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueInput weights initialization value.

Definition at line 955 of file long_short_term_memory_layer.cpp.

◆ set_inputs_number()

void set_inputs_number ( const Index &  new_inputs_number)
virtual

Sets a new number of inputs in the layer. The new biases, weights and recurrent weights are initialized at random.

Parameters
new_inputs_numberNumber of layer inputs.

Reimplemented from Layer.

Definition at line 453 of file long_short_term_memory_layer.cpp.

◆ set_name()

void set_name ( const string &  new_layer_name)

Definition at line 443 of file long_short_term_memory_layer.cpp.

◆ set_neurons_number()

void set_neurons_number ( const Index &  new_neurons_number)
virtual

Sets a new number neurons in the layer. All the parameters are also initialized at random.

Parameters
new_neurons_numberNew number of neurons in the layer.

Reimplemented from Layer.

Definition at line 477 of file long_short_term_memory_layer.cpp.

◆ set_output_biases()

void set_output_biases ( const Tensor< type, 1 > &  new_biases)

Sets the output biases of all lstm in the layer from a single vector.

Parameters
new_output_biasesNew set of output biases in the layer.

Definition at line 515 of file long_short_term_memory_layer.cpp.

◆ set_output_biases_constant()

void set_output_biases_constant ( const type &  value)

Initializes the oputput biases of all the neurons in the layer with a given value.

Parameters
valueOutput biases initialization value.

Definition at line 925 of file long_short_term_memory_layer.cpp.

◆ set_output_recurrent_weights()

void set_output_recurrent_weights ( const Tensor< type, 2 > &  new_output_recurrent_weight)

Sets the output recurrent weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of neurons in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_output_recurrent_weightsNew set of output recurrent weights in that layer.

Definition at line 613 of file long_short_term_memory_layer.cpp.

◆ set_output_recurrent_weights_constant()

void set_output_recurrent_weights_constant ( const type &  value)

Initializes the output recurrent weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueOutput recurrent weights initialization value.

Definition at line 1021 of file long_short_term_memory_layer.cpp.

◆ set_output_weights()

void set_output_weights ( const Tensor< type, 2 > &  new_output_weight)

Sets the output weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of inputs in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_output_weightsNew set of output weights in that layer.

Definition at line 563 of file long_short_term_memory_layer.cpp.

◆ set_output_weights_constant()

void set_output_weights_constant ( const type &  value)

Initializes the output weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueOutput weights initialization value.

Definition at line 973 of file long_short_term_memory_layer.cpp.

◆ set_parameters()

void set_parameters ( const Tensor< type, 1 > &  new_parameters,
const Index &  index = 0 
)
virtual

Sets the parameters of this layer.

Parameters
new_parametersParameters vector for that layer.

Reimplemented from Layer.

Definition at line 622 of file long_short_term_memory_layer.cpp.

◆ set_parameters_constant()

void set_parameters_constant ( const type &  value)
virtual

Initializes all the biases, weights and recurrent weights in the neural newtork with a given value.

Parameters
valueParameters initialization value.

Reimplemented from Layer.

Definition at line 1048 of file long_short_term_memory_layer.cpp.

◆ set_parameters_random()

void set_parameters_random ( )
virtual

Initializes all the biases, weights and recurrent weights in the neural newtork at random with values comprised between -1 and +1.

Reimplemented from Layer.

Definition at line 1074 of file long_short_term_memory_layer.cpp.

◆ set_recurrent_activation_function() [1/2]

void set_recurrent_activation_function ( const ActivationFunction new_recurrent_activation_function)

This class sets a new recurrent activation(or transfer) function in a single layer.

Parameters
new_recurrent_activation_functionActivation function for the layer.

Definition at line 794 of file long_short_term_memory_layer.cpp.

◆ set_recurrent_activation_function() [2/2]

void set_recurrent_activation_function ( const string &  new_recurrent_activation_function_name)

Sets a new recurrent activation(or transfer) function in a single layer. The argument is a string containing the name of the function("Logistic", "HyperbolicTangent", "Threshold", etc).

Parameters
new_recurrent_activation_functionRecurrent activation function for that layer.

Definition at line 804 of file long_short_term_memory_layer.cpp.

◆ set_recurrent_weights_constant()

void set_recurrent_weights_constant ( const type &  value)

Initializes the recurrent weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueRecurrent weights initialization value.

Definition at line 982 of file long_short_term_memory_layer.cpp.

◆ set_state_biases()

void set_state_biases ( const Tensor< type, 1 > &  new_biases)

Sets the state biases of all lstm in the layer from a single vector.

Parameters
new_state_biasesNew set of state biases in the layer.

Definition at line 506 of file long_short_term_memory_layer.cpp.

◆ set_state_biases_constant()

void set_state_biases_constant ( const type &  value)

Initializes the state biases of all the neurons in the layer with a given value.

Parameters
valueState biases initialization value.

Definition at line 916 of file long_short_term_memory_layer.cpp.

◆ set_state_recurrent_weights()

void set_state_recurrent_weights ( const Tensor< type, 2 > &  new_state_recurrent_weight)

Sets the state recurrent weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of neurons in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_state_recurrent_weightsNew set of state recurrent weights in that layer.

Definition at line 601 of file long_short_term_memory_layer.cpp.

◆ set_state_recurrent_weights_constant()

void set_state_recurrent_weights_constant ( const type &  value)

Initializes the state recurrent weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueState recurrent weights initialization value.

Definition at line 1012 of file long_short_term_memory_layer.cpp.

◆ set_state_weights()

void set_state_weights ( const Tensor< type, 2 > &  new_state_weights)

Sets the state weights of this lstm layer from a single matrix. The format is a matrix of real numbers. The number of rows is the number of inputs in the corresponding layer. The number of columns is the number of neurons to the corresponding layer.

Parameters
new_state_weightsNew set of state weights in that layer.

Definition at line 551 of file long_short_term_memory_layer.cpp.

◆ set_state_weights_constant()

void set_state_weights_constant ( const type &  value)

Initializes the state weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueState weights initialization value.

Definition at line 964 of file long_short_term_memory_layer.cpp.

◆ set_timesteps()

void set_timesteps ( const Index &  new_timesteps)

Sets the timesteps of the layer from a Index.

Parameters
new_timestepsNew set of timesteps in the layer.

Definition at line 866 of file long_short_term_memory_layer.cpp.

◆ set_weights_constant()

void set_weights_constant ( const type &  value)

Initializes the weights of all the neurons in the layer of neurons neuron with a given value.

Parameters
valueWeights initialization value.

Definition at line 934 of file long_short_term_memory_layer.cpp.

◆ write_activation_function()

string write_activation_function ( ) const

Returns a string with the name of the layer activation function. This can be: Logistic, HyperbolicTangent, Threshold, SymmetricThreshold, Linear, RectifiedLinear, ScaledExponentialLinear.

Definition at line 299 of file long_short_term_memory_layer.cpp.

◆ write_activation_function_expression()

string write_activation_function_expression ( ) const

Definition at line 5106 of file long_short_term_memory_layer.cpp.

◆ write_combinations_c()

string write_combinations_c ( ) const

◆ write_combinations_python()

string write_combinations_python ( ) const

◆ write_expression()

string write_expression ( const Tensor< string, 1 > &  inputs_names,
const Tensor< string, 1 > &  outputs_names 
) const
virtual

Returns a string with the expression of the inputs-outputs relationship of the layer.

Parameters
inputs_namesVector of strings with the name of the layer inputs.
outputs_namesVector of strings with the name of the layer outputs.
Todo:
Update this method.

Reimplemented from Layer.

Definition at line 3833 of file long_short_term_memory_layer.cpp.

◆ write_expression_c()

string write_expression_c ( ) const
virtual

Reimplemented from Layer.

Definition at line 3971 of file long_short_term_memory_layer.cpp.

◆ write_expression_python()

string write_expression_python ( ) const
virtual

Reimplemented from Layer.

Definition at line 4405 of file long_short_term_memory_layer.cpp.

◆ write_recurrent_activation_function()

string write_recurrent_activation_function ( ) const

Returns a string with the name of the layer recurrent activation function. This can be: Logistic, HyperbolicTangent, Threshold, SymmetricThreshold, Linear, RectifiedLinear, ScaledExponentialLinear.

Definition at line 333 of file long_short_term_memory_layer.cpp.

◆ write_recurrent_activation_function_expression()

string write_recurrent_activation_function_expression ( ) const

Definition at line 5086 of file long_short_term_memory_layer.cpp.

◆ write_XML()

void write_XML ( tinyxml2::XMLPrinter file_stream) const
virtual

Reimplemented from Layer.

Definition at line 4996 of file long_short_term_memory_layer.cpp.

Member Data Documentation

◆ activation_function

ActivationFunction activation_function = ActivationFunction::HyperbolicTangent
protected

Activation function variable.

Definition at line 318 of file long_short_term_memory_layer.h.

◆ batch

Index batch
protected

Definition at line 321 of file long_short_term_memory_layer.h.

◆ cell_states

Tensor<type, 1> cell_states
protected

Definition at line 325 of file long_short_term_memory_layer.h.

◆ display

bool display = true
protected

Display messages to screen.

Definition at line 329 of file long_short_term_memory_layer.h.

◆ forget_biases

Tensor<type, 1> forget_biases
protected

Definition at line 302 of file long_short_term_memory_layer.h.

◆ forget_recurrent_weights

Tensor<type, 2> forget_recurrent_weights
protected

Definition at line 311 of file long_short_term_memory_layer.h.

◆ forget_weights

Tensor<type, 2> forget_weights
protected

Definition at line 307 of file long_short_term_memory_layer.h.

◆ hidden_states

Tensor<type, 1> hidden_states
protected

Definition at line 324 of file long_short_term_memory_layer.h.

◆ input_biases

Tensor<type, 1> input_biases
protected

Definition at line 301 of file long_short_term_memory_layer.h.

◆ input_recurrent_weights

Tensor<type, 2> input_recurrent_weights
protected

Definition at line 312 of file long_short_term_memory_layer.h.

◆ input_weights

Tensor<type, 2> input_weights
protected

Definition at line 306 of file long_short_term_memory_layer.h.

◆ output_biases

Tensor<type, 1> output_biases
protected

Definition at line 304 of file long_short_term_memory_layer.h.

◆ output_recurrent_weights

Tensor<type, 2> output_recurrent_weights
protected

Definition at line 314 of file long_short_term_memory_layer.h.

◆ output_weights

Tensor<type, 2> output_weights
protected

Definition at line 309 of file long_short_term_memory_layer.h.

◆ recurrent_activation_function

ActivationFunction recurrent_activation_function = ActivationFunction::HardSigmoid
protected

Definition at line 319 of file long_short_term_memory_layer.h.

◆ state_biases

Tensor<type, 1> state_biases
protected

Definition at line 303 of file long_short_term_memory_layer.h.

◆ state_recurrent_weights

Tensor<type, 2> state_recurrent_weights
protected

Definition at line 313 of file long_short_term_memory_layer.h.

◆ state_weights

Tensor<type, 2> state_weights
protected

Definition at line 308 of file long_short_term_memory_layer.h.

◆ timesteps

Index timesteps = 3
protected

Definition at line 299 of file long_short_term_memory_layer.h.

◆ variables

Index variables
protected

Definition at line 322 of file long_short_term_memory_layer.h.


The documentation for this class was generated from the following files: