This abstract class represents the concept of layer of neurons in OpenNN. More...
#include <layer.h>
Public Types | |
enum class | Type { Scaling , Convolutional , Perceptron , Pooling , Probabilistic , LongShortTermMemory , Recurrent , Unscaling , Bounding } |
This enumeration represents the possible types of layers. More... | |
Public Member Functions | |
string | get_name () const |
virtual void | set_parameters_constant (const type &) |
virtual void | set_parameters_random () |
virtual Tensor< type, 1 > | get_parameters () const |
virtual Index | get_parameters_number () const |
virtual void | set_parameters (const Tensor< type, 1 > &, const Index &) |
void | set_threads_number (const int &) |
virtual void | insert_gradient (LayerBackPropagation *, const Index &, Tensor< type, 1 > &) const |
virtual Tensor< type, 2 > | calculate_outputs (const Tensor< type, 2 > &) |
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, 2 > &, LayerForwardPropagation *) |
virtual void | forward_propagate (const Tensor< type, 4 > &, LayerForwardPropagation *) |
virtual void | forward_propagate (const Tensor< type, 4 > &, Tensor< type, 1 >, LayerForwardPropagation *) |
virtual void | forward_propagate (const Tensor< type, 2 > &, Tensor< type, 1 >, LayerForwardPropagation *) |
virtual void | calculate_hidden_delta (LayerForwardPropagation *, LayerBackPropagation *, LayerBackPropagation *) const |
virtual void | calculate_hidden_delta_lm (LayerForwardPropagation *, LayerBackPropagationLM *, LayerBackPropagationLM *) const |
virtual void | calculate_error_gradient (const Tensor< type, 2 > &, LayerForwardPropagation *, LayerBackPropagation *) 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_inputs_number () const |
Returns the number of inputs. More... | |
virtual Index | get_neurons_number () const |
virtual Index | get_synaptic_weights_number () const |
Returns the number of layer's synaptic weights. More... | |
virtual void | set_inputs_number (const Index &) |
virtual void | set_neurons_number (const Index &) |
Type | get_type () const |
string | get_type_string () const |
Takes the type of layer used by the model. More... | |
virtual void | from_XML (const tinyxml2::XMLDocument &) |
virtual void | write_XML (tinyxml2::XMLPrinter &) const |
virtual string | write_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const |
virtual string | write_expression_c () const |
virtual string | write_expression_python () const |
Protected Member Functions | |
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 |
Protected Attributes | |
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)} |
This abstract class represents the concept of layer of neurons in OpenNN.
Layer is a group of neurons having connections to the same inputs and sending outputs to the same destinations. Also is used to store information about the layers of the different architectures of NeuralNetworks.
|
strong |
|
protected |
|
protected |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Reimplemented in BoundingLayer, ProbabilisticLayer, ScalingLayer, and UnscalingLayer.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in BoundingLayer, ProbabilisticLayer, ScalingLayer, and UnscalingLayer.
|
virtual |
Returns the number of inputs.
Reimplemented in BoundingLayer, ConvolutionalLayer, LongShortTermMemoryLayer, PerceptronLayer, PoolingLayer, ProbabilisticLayer, RecurrentLayer, ScalingLayer, and UnscalingLayer.
|
virtual |
Reimplemented in BoundingLayer, ConvolutionalLayer, LongShortTermMemoryLayer, PerceptronLayer, PoolingLayer, RecurrentLayer, and UnscalingLayer.
|
virtual |
Reimplemented in ConvolutionalLayer, LongShortTermMemoryLayer, PerceptronLayer, PoolingLayer, ProbabilisticLayer, and RecurrentLayer.
|
virtual |
Reimplemented in ConvolutionalLayer, LongShortTermMemoryLayer, PerceptronLayer, PoolingLayer, ProbabilisticLayer, and RecurrentLayer.
|
virtual |
Returns the number of layer's synaptic weights.
Reimplemented in ConvolutionalLayer, PerceptronLayer, and ProbabilisticLayer.
Layer::Type get_type | ( | ) | const |
string get_type_string | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlinevirtual |
|
inlinevirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
Reimplemented in BoundingLayer, LongShortTermMemoryLayer, PerceptronLayer, and RecurrentLayer.
|
virtual |
Reimplemented in BoundingLayer, LongShortTermMemoryLayer, PerceptronLayer, and RecurrentLayer.
|
virtual |
Reimplemented in LongShortTermMemoryLayer, RecurrentLayer, ConvolutionalLayer, and PerceptronLayer.
|
virtual |
Reimplemented in ConvolutionalLayer, LongShortTermMemoryLayer, PerceptronLayer, ProbabilisticLayer, and RecurrentLayer.
|
virtual |
Reimplemented in LongShortTermMemoryLayer, PerceptronLayer, ProbabilisticLayer, and RecurrentLayer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inlinevirtual |
Reimplemented in BoundingLayer, LongShortTermMemoryLayer, PerceptronLayer, RecurrentLayer, ScalingLayer, and UnscalingLayer.
|
inlinevirtual |
Reimplemented in BoundingLayer, ScalingLayer, and UnscalingLayer.
|
inlinevirtual |
Reimplemented in BoundingLayer, and UnscalingLayer.
|
inlinevirtual |
Reimplemented in BoundingLayer, ProbabilisticLayer, ScalingLayer, and UnscalingLayer.
|
protected |
|
protected |
|
protected |
|
protected |