#include <long_short_term_memory_layer.h>
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... | |
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 |
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.
|
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.
|
explicit |
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.
|
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.
new_inputs_number | Number of inputs in the layer. |
new_neurons_number | Number of neurons in the layer. |
Definition at line 35 of file long_short_term_memory_layer.cpp.
|
virtual |
Destructor. This destructor does not delete any pointer.
Definition at line 46 of file long_short_term_memory_layer.cpp.
Tensor< type, 1 > calculate_activations | ( | const Tensor< type, 1 > & | combinations_1d | ) | const |
Definition at line 1271 of file long_short_term_memory_layer.cpp.
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.
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.
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.
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.
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.
|
virtual |
Reimplemented from Layer.
Definition at line 2110 of file long_short_term_memory_layer.cpp.
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.
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.
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.
|
virtual |
Reimplemented from Layer.
Definition at line 1648 of file long_short_term_memory_layer.cpp.
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.
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.
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.
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.
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.
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.
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.
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.
|
virtual |
Reimplemented from Layer.
Definition at line 1573 of file long_short_term_memory_layer.cpp.
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.
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.
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.
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.
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.
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.
|
virtual |
Reimplemented from Layer.
Definition at line 1774 of file long_short_term_memory_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 1906 of file long_short_term_memory_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 4849 of file long_short_term_memory_layer.cpp.
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.
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.
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.
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.
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.
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.
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.
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.
|
virtual |
Returns the number of inputs to the layer.
Reimplemented from Layer.
Definition at line 53 of file long_short_term_memory_layer.cpp.
|
virtual |
Returns the size of the neurons vector.
Reimplemented from Layer.
Definition at line 61 of file long_short_term_memory_layer.cpp.
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.
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.
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.
|
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.
|
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.
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.
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.
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.
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.
Index get_timesteps | ( | ) | const |
Returns the number of timesteps.
Definition at line 205 of file long_short_term_memory_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 2044 of file long_short_term_memory_layer.cpp.
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.
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.
new_inputs_number | Number of inputs. |
new_neurons_number | Number of neurons. |
Definition at line 387 of file long_short_term_memory_layer.cpp.
void set | ( | const LongShortTermMemoryLayer & | other_neuron_layer | ) |
Sets the members of this neuron layer object with those from other neuron layer object.
other_neuron_layer | LongShortTermMemoryLayer object to be copied. |
Definition at line 419 of file long_short_term_memory_layer.cpp.
void set_activation_function | ( | const ActivationFunction & | new_activation_function | ) |
This class sets a new activation(or transfer) function in a single layer.
new_activation_function | Activation function for the layer. |
Definition at line 722 of file long_short_term_memory_layer.cpp.
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).
new_activation_function | Activation function for that layer. |
Definition at line 732 of file long_short_term_memory_layer.cpp.
void set_biases_constant | ( | const type & | value | ) |
Initializes the biases of all the neurons in the layer with a given value.
value | Biases initialization value. |
Definition at line 886 of file long_short_term_memory_layer.cpp.
void set_cell_states_constant | ( | const type & | value | ) |
Initializes cell states of the layer with a given value.
value | Cell states initialization value. |
Definition at line 1039 of file long_short_term_memory_layer.cpp.
void set_default | ( | ) |
Sets those members not related to the vector of neurons to their default value.
Definition at line 436 of file long_short_term_memory_layer.cpp.
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.
new_display | Display value. |
Definition at line 877 of file long_short_term_memory_layer.cpp.
void set_forget_biases | ( | const Tensor< type, 1 > & | new_biases | ) |
Sets the forget biases of all lstm in the layer from a single vector.
new_forget_biases | New set of forget biases in the layer. |
Definition at line 488 of file long_short_term_memory_layer.cpp.
void set_forget_biases_constant | ( | const type & | value | ) |
Initializes the forget biases of all the neurons in the layer with a given value.
value | Forget biases initialization value. |
Definition at line 898 of file long_short_term_memory_layer.cpp.
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.
new_forget_recurrent_weights | New set of forget recurrent weights in that layer. |
Definition at line 576 of file long_short_term_memory_layer.cpp.
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.
value | Forget recurrent weights initialization value. |
Definition at line 994 of file long_short_term_memory_layer.cpp.
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.
new_forget_weights | New set of forget weights in that layer. |
Definition at line 527 of file long_short_term_memory_layer.cpp.
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.
value | Forget weights initialization value. |
Definition at line 946 of file long_short_term_memory_layer.cpp.
void set_hidden_states_constant | ( | const type & | value | ) |
Initializes hidden states of the layer with a given value.
value | Hidden states initialization value. |
Definition at line 1030 of file long_short_term_memory_layer.cpp.
void set_input_biases | ( | const Tensor< type, 1 > & | new_biases | ) |
Sets the input biases of all lstm in the layer from a single vector.
new_input_biases | New set of input biases in the layer. |
Definition at line 497 of file long_short_term_memory_layer.cpp.
void set_input_biases_constant | ( | const type & | value | ) |
Initializes the input biases of all the neurons in the layer with a given value.
value | Input biases initialization value. |
Definition at line 907 of file long_short_term_memory_layer.cpp.
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.
new_input_recurrent_weights | New set of input recurrent weights in that layer. |
Definition at line 589 of file long_short_term_memory_layer.cpp.
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.
value | Input recurrent weights initialization value. |
Definition at line 1003 of file long_short_term_memory_layer.cpp.
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.
size | dimensions of layer inputs. |
Definition at line 465 of file long_short_term_memory_layer.cpp.
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.
new_input_weights | New set of input weights in that layer. |
Definition at line 539 of file long_short_term_memory_layer.cpp.
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.
value | Input weights initialization value. |
Definition at line 955 of file long_short_term_memory_layer.cpp.
|
virtual |
Sets a new number of inputs in the layer. The new biases, weights and recurrent weights are initialized at random.
new_inputs_number | Number of layer inputs. |
Reimplemented from Layer.
Definition at line 453 of file long_short_term_memory_layer.cpp.
void set_name | ( | const string & | new_layer_name | ) |
Definition at line 443 of file long_short_term_memory_layer.cpp.
|
virtual |
Sets a new number neurons in the layer. All the parameters are also initialized at random.
new_neurons_number | New number of neurons in the layer. |
Reimplemented from Layer.
Definition at line 477 of file long_short_term_memory_layer.cpp.
void set_output_biases | ( | const Tensor< type, 1 > & | new_biases | ) |
Sets the output biases of all lstm in the layer from a single vector.
new_output_biases | New set of output biases in the layer. |
Definition at line 515 of file long_short_term_memory_layer.cpp.
void set_output_biases_constant | ( | const type & | value | ) |
Initializes the oputput biases of all the neurons in the layer with a given value.
value | Output biases initialization value. |
Definition at line 925 of file long_short_term_memory_layer.cpp.
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.
new_output_recurrent_weights | New set of output recurrent weights in that layer. |
Definition at line 613 of file long_short_term_memory_layer.cpp.
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.
value | Output recurrent weights initialization value. |
Definition at line 1021 of file long_short_term_memory_layer.cpp.
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.
new_output_weights | New set of output weights in that layer. |
Definition at line 563 of file long_short_term_memory_layer.cpp.
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.
value | Output weights initialization value. |
Definition at line 973 of file long_short_term_memory_layer.cpp.
|
virtual |
Sets the parameters of this layer.
new_parameters | Parameters vector for that layer. |
Reimplemented from Layer.
Definition at line 622 of file long_short_term_memory_layer.cpp.
|
virtual |
Initializes all the biases, weights and recurrent weights in the neural newtork with a given value.
value | Parameters initialization value. |
Reimplemented from Layer.
Definition at line 1048 of file long_short_term_memory_layer.cpp.
|
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.
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.
new_recurrent_activation_function | Activation function for the layer. |
Definition at line 794 of file long_short_term_memory_layer.cpp.
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).
new_recurrent_activation_function | Recurrent activation function for that layer. |
Definition at line 804 of file long_short_term_memory_layer.cpp.
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.
value | Recurrent weights initialization value. |
Definition at line 982 of file long_short_term_memory_layer.cpp.
void set_state_biases | ( | const Tensor< type, 1 > & | new_biases | ) |
Sets the state biases of all lstm in the layer from a single vector.
new_state_biases | New set of state biases in the layer. |
Definition at line 506 of file long_short_term_memory_layer.cpp.
void set_state_biases_constant | ( | const type & | value | ) |
Initializes the state biases of all the neurons in the layer with a given value.
value | State biases initialization value. |
Definition at line 916 of file long_short_term_memory_layer.cpp.
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.
new_state_recurrent_weights | New set of state recurrent weights in that layer. |
Definition at line 601 of file long_short_term_memory_layer.cpp.
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.
value | State recurrent weights initialization value. |
Definition at line 1012 of file long_short_term_memory_layer.cpp.
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.
new_state_weights | New set of state weights in that layer. |
Definition at line 551 of file long_short_term_memory_layer.cpp.
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.
value | State weights initialization value. |
Definition at line 964 of file long_short_term_memory_layer.cpp.
void set_timesteps | ( | const Index & | new_timesteps | ) |
Sets the timesteps of the layer from a Index.
new_timesteps | New set of timesteps in the layer. |
Definition at line 866 of file long_short_term_memory_layer.cpp.
void set_weights_constant | ( | const type & | value | ) |
Initializes the weights of all the neurons in the layer of neurons neuron with a given value.
value | Weights initialization value. |
Definition at line 934 of file long_short_term_memory_layer.cpp.
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.
string write_activation_function_expression | ( | ) | const |
Definition at line 5106 of file long_short_term_memory_layer.cpp.
string write_combinations_c | ( | ) | const |
string write_combinations_python | ( | ) | const |
|
virtual |
Returns a string with the expression of the inputs-outputs relationship of the layer.
inputs_names | Vector of strings with the name of the layer inputs. |
outputs_names | Vector of strings with the name of the layer outputs. |
Reimplemented from Layer.
Definition at line 3833 of file long_short_term_memory_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 3971 of file long_short_term_memory_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 4405 of file long_short_term_memory_layer.cpp.
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.
string write_recurrent_activation_function_expression | ( | ) | const |
Definition at line 5086 of file long_short_term_memory_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 4996 of file long_short_term_memory_layer.cpp.
|
protected |
Activation function variable.
Definition at line 318 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 321 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 325 of file long_short_term_memory_layer.h.
|
protected |
Display messages to screen.
Definition at line 329 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 302 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 311 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 307 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 324 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 301 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 312 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 306 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 304 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 314 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 309 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 319 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 303 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 313 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 308 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 299 of file long_short_term_memory_layer.h.
|
protected |
Definition at line 322 of file long_short_term_memory_layer.h.