This class represents a layer of perceptrons. More...
#include <perceptron_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 perceptron neuron model. 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 | |
PerceptronLayer () | |
PerceptronLayer (const Index &, const Index &, const ActivationFunction &=PerceptronLayer::ActivationFunction::HyperbolicTangent) | |
virtual | ~PerceptronLayer () |
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 number of neurons in the layer. More... | |
const Tensor< type, 2 > & | get_biases () const |
const Tensor< type, 2 > & | get_synaptic_weights () const |
Tensor< type, 2 > | get_biases (const Tensor< type, 1 > &) const |
Tensor< type, 2 > | get_synaptic_weights (const Tensor< type, 1 > &) const |
Index | get_biases_number () const |
Index | get_synaptic_weights_number () const |
Returns the number of layer's synaptic weights. More... | |
Index | get_parameters_number () const |
Returns the number of parameters(biases and synaptic weights) of the layer. More... | |
Tensor< type, 1 > | get_parameters () const |
const PerceptronLayer::ActivationFunction & | get_activation_function () const |
string | write_activation_function () const |
const bool & | get_display () const |
void | set () |
void | set (const Index &, const Index &, const PerceptronLayer::ActivationFunction &=PerceptronLayer::ActivationFunction::HyperbolicTangent) |
void | set_default () |
void | set_name (const string &) |
void | set_inputs_number (const Index &) |
void | set_neurons_number (const Index &) |
void | set_biases (const Tensor< type, 2 > &) |
void | set_synaptic_weights (const Tensor< type, 2 > &) |
void | set_parameters (const Tensor< type, 1 > &, const Index &index=0) |
Sets the parameters of this layer. More... | |
void | set_activation_function (const ActivationFunction &) |
void | set_activation_function (const string &) |
void | set_display (const bool &) |
void | set_biases_constant (const type &) |
void | set_synaptic_weights_constant (const type &) |
void | set_parameters_constant (const type &) |
void | set_parameters_random () |
void | calculate_combinations (const Tensor< type, 2 > &, const Tensor< type, 2 > &, const Tensor< type, 2 > &, Tensor< type, 2 > &) const |
void | calculate_activations (const Tensor< type, 2 > &, Tensor< type, 2 > &) const |
void | calculate_activations_derivatives (const Tensor< type, 2 > &, Tensor< type, 2 > &, Tensor< type, 2 > &) const |
Tensor< type, 2 > | calculate_outputs (const Tensor< type, 2 > &) |
void | forward_propagate (const Tensor< type, 2 > &, LayerForwardPropagation *) |
void | forward_propagate (const Tensor< type, 2 > &, Tensor< type, 1 >, LayerForwardPropagation *) |
void | calculate_hidden_delta (LayerForwardPropagation *, LayerBackPropagation *, LayerForwardPropagation *, LayerBackPropagation *) const |
void | calculate_hidden_delta_perceptron (PerceptronLayerForwardPropagation *, PerceptronLayerBackPropagation *, PerceptronLayerBackPropagation *) const |
void | calculate_hidden_delta_probabilistic (ProbabilisticLayerForwardPropagation *, ProbabilisticLayerBackPropagation *, PerceptronLayerBackPropagation *) const |
void | calculate_hidden_delta_lm (LayerForwardPropagation *, LayerBackPropagationLM *, LayerBackPropagationLM *) const |
void | calculate_hidden_delta_perceptron_lm (PerceptronLayerForwardPropagation *, PerceptronLayerBackPropagationLM *, PerceptronLayerBackPropagationLM *) const |
void | calculate_hidden_delta_probabilistic_lm (ProbabilisticLayerForwardPropagation *, ProbabilisticLayerBackPropagationLM *, PerceptronLayerBackPropagationLM *) const |
void | calculate_squared_errors_Jacobian_lm (const Tensor< type, 2 > &, LayerForwardPropagation *, LayerBackPropagationLM *) |
void | insert_squared_errors_Jacobian_lm (LayerBackPropagationLM *, const Index &, Tensor< type, 2 > &) const |
void | calculate_error_gradient (const Tensor< type, 2 > &, LayerForwardPropagation *, LayerBackPropagation *) const |
void | insert_gradient (LayerBackPropagation *, const Index &, Tensor< type, 1 > &) const |
string | write_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const |
string | write_activation_function_expression () const |
string | write_expression_c () const |
string | write_combinations_c () const |
string | write_activations_c () const |
string | write_combinations_python () const |
string | write_activations_python () const |
string | write_expression_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_error_gradient (const Tensor< type, 4 > &, LayerForwardPropagation *, LayerBackPropagation *) const |
Type | get_type () const |
string | get_type_string () const |
Takes the type of layer used by the model. More... | |
Protected Attributes | |
Tensor< type, 2 > | biases |
Tensor< type, 2 > | synaptic_weights |
This matrix containing conection strengths from a layer's inputs to its neurons. More... | |
ActivationFunction | activation_function |
Activation function variable. More... | |
bool | display = true |
Display messages to screen. More... | |
Protected Attributes inherited from Layer | |
ThreadPool * | 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 perceptrons.
PerceptronLayer is a single-layer network with a hard-limit trabsfer function. This network is often trained with the perceptron learning rule.
Layers of perceptrons will be used to construct multilayer perceptrons, such as an approximation problems .
Definition at line 48 of file perceptron_layer.h.
|
strong |
Enumeration of available activation functions for the perceptron neuron model.
Definition at line 56 of file perceptron_layer.h.
|
explicit |
Default constructor. It creates a empty layer object, with no perceptrons. This constructor also initializes the rest of class members to their default values.
Definition at line 18 of file perceptron_layer.cpp.
|
explicit |
Layer architecture constructor. It creates a layer object with given numbers of inputs and perceptrons. 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 perceptrons in the layer. |
new_activation_function | Activation function for the perceptron layer. |
Definition at line 34 of file perceptron_layer.cpp.
|
virtual |
Destructor. This destructor does not delete any pointer.
Definition at line 48 of file perceptron_layer.cpp.
void calculate_activations | ( | const Tensor< type, 2 > & | combinations, |
Tensor< type, 2 > & | activations | ||
) | const |
Definition at line 515 of file perceptron_layer.cpp.
void calculate_activations_derivatives | ( | const Tensor< type, 2 > & | combinations, |
Tensor< type, 2 > & | activations, | ||
Tensor< type, 2 > & | activations_derivatives | ||
) | const |
Definition at line 549 of file perceptron_layer.cpp.
void calculate_combinations | ( | const Tensor< type, 2 > & | inputs, |
const Tensor< type, 2 > & | biases, | ||
const Tensor< type, 2 > & | synaptic_weights, | ||
Tensor< type, 2 > & | combinations | ||
) | const |
Definition at line 491 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 988 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 657 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 807 of file perceptron_layer.cpp.
void calculate_hidden_delta_perceptron | ( | PerceptronLayerForwardPropagation * | next_forward_propagation, |
PerceptronLayerBackPropagation * | next_back_propagation, | ||
PerceptronLayerBackPropagation * | back_propagation | ||
) | const |
Definition at line 707 of file perceptron_layer.cpp.
void calculate_hidden_delta_perceptron_lm | ( | PerceptronLayerForwardPropagation * | next_forward_propagation, |
PerceptronLayerBackPropagationLM * | next_back_propagation, | ||
PerceptronLayerBackPropagationLM * | back_propagation | ||
) | const |
Definition at line 849 of file perceptron_layer.cpp.
void calculate_hidden_delta_probabilistic | ( | ProbabilisticLayerForwardPropagation * | next_forward_propagation, |
ProbabilisticLayerBackPropagation * | next_back_propagation, | ||
PerceptronLayerBackPropagation * | back_propagation | ||
) | const |
Definition at line 722 of file perceptron_layer.cpp.
void calculate_hidden_delta_probabilistic_lm | ( | ProbabilisticLayerForwardPropagation * | next_forward_propagation, |
ProbabilisticLayerBackPropagationLM * | next_back_propagation, | ||
PerceptronLayerBackPropagationLM * | back_propagation | ||
) | const |
Definition at line 860 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 586 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 931 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 605 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 626 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 1065 of file perceptron_layer.cpp.
const PerceptronLayer::ActivationFunction & get_activation_function | ( | ) | const |
Returns the activation function of the layer. The activation function of a layer is the activation function of all perceptrons in it.
Definition at line 172 of file perceptron_layer.cpp.
const Tensor< type, 2 > & get_biases | ( | ) | const |
Returns the biases from all the perceptrons 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 95 of file perceptron_layer.cpp.
Tensor< type, 2 > get_biases | ( | const Tensor< type, 1 > & | parameters | ) | const |
Definition at line 132 of file perceptron_layer.cpp.
Index get_biases_number | ( | ) | const |
Definition at line 69 of file perceptron_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 226 of file perceptron_layer.cpp.
|
virtual |
Returns the number of inputs to the layer.
Reimplemented from Layer.
Definition at line 55 of file perceptron_layer.cpp.
|
virtual |
Returns the number of neurons in the layer.
Reimplemented from Layer.
Definition at line 63 of file perceptron_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 151 of file perceptron_layer.cpp.
|
virtual |
Returns the number of parameters(biases and synaptic weights) of the layer.
Reimplemented from Layer.
Definition at line 85 of file perceptron_layer.cpp.
const Tensor< type, 2 > & get_synaptic_weights | ( | ) | const |
Returns the synaptic weights from the perceptrons. 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 inputs to the layer.
Definition at line 106 of file perceptron_layer.cpp.
Tensor< type, 2 > get_synaptic_weights | ( | const Tensor< type, 1 > & | parameters | ) | const |
Definition at line 112 of file perceptron_layer.cpp.
|
virtual |
Returns the number of layer's synaptic weights.
Reimplemented from Layer.
Definition at line 77 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 1013 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 972 of file perceptron_layer.cpp.
void set | ( | ) |
Sets an empty layer, wihtout any perceptron. It also sets the rest of members to their default values.
Definition at line 235 of file perceptron_layer.cpp.
void set | ( | const Index & | new_inputs_number, |
const Index & | new_neurons_number, | ||
const PerceptronLayer::ActivationFunction & | new_activation_function = PerceptronLayer::ActivationFunction::HyperbolicTangent |
||
) |
Sets new numbers of inputs and perceptrons 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 perceptron neurons. |
new_activation_function | Activation function for the perceptron layer. |
Definition at line 251 of file perceptron_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 358 of file perceptron_layer.cpp.
void set_activation_function | ( | const string & | new_activation_function_name | ) |
Sets a new activation(or transfer) function in a single layer. The second argument is a string containing the name of the function("Logistic", "HyperbolicTangent", "Threshold", etc).
new_activation_function_name | Activation function for that layer. |
Definition at line 368 of file perceptron_layer.cpp.
void set_biases | ( | const Tensor< type, 2 > & | new_biases | ) |
Sets the biases of all perceptrons in the layer from a single vector.
new_biases | New set of biases in the layer. |
Definition at line 320 of file perceptron_layer.cpp.
void set_biases_constant | ( | const type & | value | ) |
Initializes the biases of all the perceptrons in the layer of perceptrons with a given value.
value | Biases initialization value. |
Definition at line 441 of file perceptron_layer.cpp.
void set_default | ( | ) |
Sets those members not related to the vector of perceptrons to their default value.
Definition at line 273 of file perceptron_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 432 of file perceptron_layer.cpp.
|
virtual |
Sets a new number of inputs in the layer. The new synaptic weights are initialized at random.
new_inputs_number | Number of layer inputs. |
Reimplemented from Layer.
Definition at line 293 of file perceptron_layer.cpp.
void set_name | ( | const string & | new_layer_name | ) |
Definition at line 283 of file perceptron_layer.cpp.
|
virtual |
Sets a new number perceptrons 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 307 of file perceptron_layer.cpp.
|
virtual |
Sets the parameters of this layer.
Reimplemented from Layer.
Definition at line 340 of file perceptron_layer.cpp.
|
virtual |
Initializes all the biases and synaptic weights in the neural newtork with a given value.
value | Parameters initialization value. |
Reimplemented from Layer.
Definition at line 459 of file perceptron_layer.cpp.
|
virtual |
Initializes all the biases and synaptic weights in the neural newtork at random with values comprised between -1 and +1.
Reimplemented from Layer.
Definition at line 470 of file perceptron_layer.cpp.
void set_synaptic_weights | ( | const Tensor< type, 2 > & | new_synaptic_weights | ) |
Sets the synaptic weights of this perceptron 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 inputs to the corresponding layer.
new_synaptic_weights | New set of synaptic weights in that layer. |
Definition at line 332 of file perceptron_layer.cpp.
void set_synaptic_weights_constant | ( | const type & | value | ) |
Initializes the synaptic weights of all the perceptrons in the layer of perceptrons with a given value.
value | Synaptic weights initialization value. |
Definition at line 450 of file perceptron_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 181 of file perceptron_layer.cpp.
string write_activation_function_expression | ( | ) | const |
Definition at line 1246 of file perceptron_layer.cpp.
string write_activations_c | ( | ) | const |
Definition at line 1313 of file perceptron_layer.cpp.
string write_activations_python | ( | ) | const |
Definition at line 1404 of file perceptron_layer.cpp.
string write_combinations_c | ( | ) | const |
Definition at line 1288 of file perceptron_layer.cpp.
string write_combinations_python | ( | ) | const |
Definition at line 1377 of file perceptron_layer.cpp.
|
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 1037 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 1469 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 1485 of file perceptron_layer.cpp.
|
virtual |
Reimplemented from Layer.
Definition at line 1176 of file perceptron_layer.cpp.
|
protected |
Activation function variable.
Definition at line 248 of file perceptron_layer.h.
|
protected |
Bias is a neuron parameter that is summed with the neuron's weighted inputs and passed through the neuron's transfer function to generate the neuron's output.
Definition at line 240 of file perceptron_layer.h.
|
protected |
Display messages to screen.
Definition at line 252 of file perceptron_layer.h.
|
protected |
This matrix containing conection strengths from a layer's inputs to its neurons.
Definition at line 244 of file perceptron_layer.h.