Layer Class Reference

This abstract class represents the concept of layer of neurons in OpenNN. More...

#include <layer.h>

Inheritance diagram for Layer:
BoundingLayer ConvolutionalLayer LongShortTermMemoryLayer PerceptronLayer PoolingLayer ProbabilisticLayer RecurrentLayer ScalingLayer UnscalingLayer

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)}
 

Detailed Description

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.

Definition at line 52 of file layer.h.

Member Enumeration Documentation

◆ Type

enum class Type
strong

This enumeration represents the possible types of layers.

Definition at line 61 of file layer.h.

Constructor & Destructor Documentation

◆ Layer()

Layer ( )
inlineexplicit

Definition at line 66 of file layer.h.

◆ ~Layer()

~Layer ( )
virtual

Definition at line 14 of file layer.cpp.

Member Function Documentation

◆ binary() [1/2]

void binary ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 351 of file layer.cpp.

◆ binary() [2/2]

void binary ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 767 of file layer.cpp.

◆ calculate_error_gradient() [1/2]

virtual void calculate_error_gradient ( const Tensor< type, 2 > &  ,
LayerForwardPropagation ,
LayerBackPropagation  
) const
inlinevirtual

Definition at line 126 of file layer.h.

◆ calculate_error_gradient() [2/2]

virtual void calculate_error_gradient ( const Tensor< type, 4 > &  ,
LayerForwardPropagation ,
LayerBackPropagation  
) const
inlinevirtual

Definition at line 130 of file layer.h.

◆ calculate_hidden_delta()

virtual void calculate_hidden_delta ( LayerForwardPropagation ,
LayerBackPropagation ,
LayerBackPropagation  
) const
inlinevirtual

Definition at line 116 of file layer.h.

◆ calculate_hidden_delta_lm()

virtual void calculate_hidden_delta_lm ( LayerForwardPropagation ,
LayerBackPropagationLM ,
LayerBackPropagationLM  
) const
inlinevirtual

Definition at line 120 of file layer.h.

◆ calculate_outputs()

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

Reimplemented in BoundingLayer, ProbabilisticLayer, ScalingLayer, and UnscalingLayer.

Definition at line 139 of file layer.cpp.

◆ calculate_outputs_4D()

virtual Tensor< type, 4 > calculate_outputs_4D ( const Tensor< type, 4 > &  )
inlinevirtual

Definition at line 106 of file layer.h.

◆ calculate_outputs_from4D()

virtual Tensor< type, 2 > calculate_outputs_from4D ( const Tensor< type, 4 > &  )
inlinevirtual

Definition at line 104 of file layer.h.

◆ calculate_squared_errors_Jacobian_lm()

virtual void calculate_squared_errors_Jacobian_lm ( const Tensor< type, 2 > &  ,
LayerForwardPropagation ,
LayerBackPropagationLM  
)
inlinevirtual

Definition at line 136 of file layer.h.

◆ competitive() [1/2]

void competitive ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 367 of file layer.cpp.

◆ competitive() [2/2]

void competitive ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected
Todo:
exception with several maximum indices

Definition at line 785 of file layer.cpp.

◆ exponential_linear() [1/3]

void exponential_linear ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 333 of file layer.cpp.

◆ exponential_linear() [2/3]

void exponential_linear ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 749 of file layer.cpp.

◆ exponential_linear() [3/3]

void exponential_linear ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1303 of file layer.cpp.

◆ exponential_linear_derivatives() [1/3]

void exponential_linear_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 594 of file layer.cpp.

◆ exponential_linear_derivatives() [2/3]

void exponential_linear_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 1054 of file layer.cpp.

◆ exponential_linear_derivatives() [3/3]

void exponential_linear_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1543 of file layer.cpp.

◆ forward_propagate() [1/4]

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

Definition at line 108 of file layer.h.

◆ forward_propagate() [2/4]

virtual void forward_propagate ( const Tensor< type, 2 > &  ,
Tensor< type, 1 >  ,
LayerForwardPropagation  
)
inlinevirtual

Definition at line 112 of file layer.h.

◆ forward_propagate() [3/4]

virtual void forward_propagate ( const Tensor< type, 4 > &  ,
LayerForwardPropagation  
)
inlinevirtual

Definition at line 109 of file layer.h.

◆ forward_propagate() [4/4]

virtual void forward_propagate ( const Tensor< type, 4 > &  ,
Tensor< type, 1 >  ,
LayerForwardPropagation  
)
inlinevirtual

Definition at line 111 of file layer.h.

◆ from_XML()

virtual void from_XML ( const tinyxml2::XMLDocument )
inlinevirtual

Reimplemented in BoundingLayer, ProbabilisticLayer, ScalingLayer, and UnscalingLayer.

Definition at line 160 of file layer.h.

◆ get_inputs_number()

Index get_inputs_number ( ) const
virtual

◆ get_name()

string get_name ( ) const
inline

Definition at line 78 of file layer.h.

◆ get_neurons_number()

Index get_neurons_number ( ) const
virtual

◆ get_parameters()

Tensor< type, 1 > get_parameters ( ) const
virtual

◆ get_parameters_number()

Index get_parameters_number ( ) const
virtual

◆ get_synaptic_weights_number()

Index get_synaptic_weights_number ( ) const
virtual

Returns the number of layer's synaptic weights.

Reimplemented in ConvolutionalLayer, PerceptronLayer, and ProbabilisticLayer.

Definition at line 179 of file layer.cpp.

◆ get_type()

Layer::Type get_type ( ) const

Default constructor. It creates a layer object with zero parameters. It also initializes the rest of class members to their default values.

Definition at line 25 of file layer.cpp.

◆ get_type_string()

string get_type_string ( ) const

Takes the type of layer used by the model.

Definition at line 33 of file layer.cpp.

◆ hard_sigmoid() [1/3]

void hard_sigmoid ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 215 of file layer.cpp.

◆ hard_sigmoid() [2/3]

void hard_sigmoid ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 627 of file layer.cpp.

◆ hard_sigmoid() [3/3]

void hard_sigmoid ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected
Todo:
Test this method.

Definition at line 1281 of file layer.cpp.

◆ hard_sigmoid_derivatives() [1/3]

void hard_sigmoid_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 387 of file layer.cpp.

◆ hard_sigmoid_derivatives() [2/3]

void hard_sigmoid_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 836 of file layer.cpp.

◆ hard_sigmoid_derivatives() [3/3]

void hard_sigmoid_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1505 of file layer.cpp.

◆ hyperbolic_tangent() [1/3]

void hyperbolic_tangent ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 232 of file layer.cpp.

◆ hyperbolic_tangent() [2/3]

void hyperbolic_tangent ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 651 of file layer.cpp.

◆ hyperbolic_tangent() [3/3]

void hyperbolic_tangent ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1193 of file layer.cpp.

◆ hyperbolic_tangent_derivatives() [1/3]

void hyperbolic_tangent_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 426 of file layer.cpp.

◆ hyperbolic_tangent_derivatives() [2/3]

void hyperbolic_tangent_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 874 of file layer.cpp.

◆ hyperbolic_tangent_derivatives() [3/3]

void hyperbolic_tangent_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1346 of file layer.cpp.

◆ insert_gradient()

virtual void insert_gradient ( LayerBackPropagation ,
const Index &  ,
Tensor< type, 1 > &   
) const
inlinevirtual

Definition at line 98 of file layer.h.

◆ insert_squared_errors_Jacobian_lm()

virtual void insert_squared_errors_Jacobian_lm ( LayerBackPropagationLM ,
const Index &  ,
Tensor< type, 2 > &   
) const
inlinevirtual

Definition at line 140 of file layer.h.

◆ linear() [1/3]

void linear ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 244 of file layer.cpp.

◆ linear() [2/3]

void linear ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 663 of file layer.cpp.

◆ linear() [3/3]

void linear ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1181 of file layer.cpp.

◆ linear_derivatives() [1/3]

void linear_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 450 of file layer.cpp.

◆ linear_derivatives() [2/3]

void linear_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 902 of file layer.cpp.

◆ linear_derivatives() [3/3]

void linear_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1322 of file layer.cpp.

◆ logistic() [1/3]

void logistic ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 238 of file layer.cpp.

◆ logistic() [2/3]

void logistic ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 657 of file layer.cpp.

◆ logistic() [3/3]

void logistic ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1187 of file layer.cpp.

◆ logistic_derivatives() [1/4]

void logistic_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 440 of file layer.cpp.

◆ logistic_derivatives() [2/4]

void logistic_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 888 of file layer.cpp.

◆ logistic_derivatives() [3/4]

void logistic_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 3 > &  activations_derivatives 
) const
protected

Definition at line 1084 of file layer.cpp.

◆ logistic_derivatives() [4/4]

void logistic_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1332 of file layer.cpp.

◆ rectified_linear() [1/3]

void rectified_linear ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 276 of file layer.cpp.

◆ rectified_linear() [2/3]

void rectified_linear ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 695 of file layer.cpp.

◆ rectified_linear() [3/3]

void rectified_linear ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1225 of file layer.cpp.

◆ rectified_linear_derivatives() [1/3]

void rectified_linear_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 502 of file layer.cpp.

◆ rectified_linear_derivatives() [2/3]

void rectified_linear_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 958 of file layer.cpp.

◆ rectified_linear_derivatives() [3/3]

void rectified_linear_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1402 of file layer.cpp.

◆ scaled_exponential_linear() [1/3]

void scaled_exponential_linear ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 288 of file layer.cpp.

◆ scaled_exponential_linear() [2/3]

void scaled_exponential_linear ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 707 of file layer.cpp.

◆ scaled_exponential_linear() [3/3]

void scaled_exponential_linear ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1237 of file layer.cpp.

◆ scaled_exponential_linear_derivatives() [1/3]

void scaled_exponential_linear_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 524 of file layer.cpp.

◆ scaled_exponential_linear_derivatives() [2/3]

void scaled_exponential_linear_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 980 of file layer.cpp.

◆ scaled_exponential_linear_derivatives() [3/3]

void scaled_exponential_linear_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1425 of file layer.cpp.

◆ set_inputs_number()

void set_inputs_number ( const Index &  )
virtual

Reimplemented in BoundingLayer, LongShortTermMemoryLayer, PerceptronLayer, and RecurrentLayer.

Definition at line 191 of file layer.cpp.

◆ set_neurons_number()

void set_neurons_number ( const Index &  )
virtual

Reimplemented in BoundingLayer, LongShortTermMemoryLayer, PerceptronLayer, and RecurrentLayer.

Definition at line 203 of file layer.cpp.

◆ set_parameters()

void set_parameters ( const Tensor< type, 1 > &  ,
const Index &   
)
virtual

Reimplemented in LongShortTermMemoryLayer, RecurrentLayer, ConvolutionalLayer, and PerceptronLayer.

Definition at line 103 of file layer.cpp.

◆ set_parameters_constant()

void set_parameters_constant ( const type &  )
virtual

◆ set_parameters_random()

void set_parameters_random ( )
virtual

Reimplemented in LongShortTermMemoryLayer, PerceptronLayer, ProbabilisticLayer, and RecurrentLayer.

Definition at line 91 of file layer.cpp.

◆ set_threads_number()

void set_threads_number ( const int &  new_threads_number)

Definition at line 69 of file layer.cpp.

◆ soft_plus() [1/3]

void soft_plus ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 309 of file layer.cpp.

◆ soft_plus() [2/3]

void soft_plus ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 727 of file layer.cpp.

◆ soft_plus() [3/3]

void soft_plus ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1257 of file layer.cpp.

◆ soft_plus_derivatives() [1/3]

void soft_plus_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 556 of file layer.cpp.

◆ soft_plus_derivatives() [2/3]

void soft_plus_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 1013 of file layer.cpp.

◆ soft_plus_derivatives() [3/3]

void soft_plus_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1459 of file layer.cpp.

◆ soft_sign() [1/3]

void soft_sign ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 316 of file layer.cpp.

◆ soft_sign() [2/3]

void soft_sign ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 733 of file layer.cpp.

◆ soft_sign() [3/3]

void soft_sign ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1263 of file layer.cpp.

◆ soft_sign_derivatives() [1/3]

void soft_sign_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 566 of file layer.cpp.

◆ soft_sign_derivatives() [2/3]

void soft_sign_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 1025 of file layer.cpp.

◆ soft_sign_derivatives() [3/3]

void soft_sign_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1475 of file layer.cpp.

◆ softmax() [1/2]

void softmax ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 377 of file layer.cpp.

◆ softmax() [2/2]

void softmax ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 803 of file layer.cpp.

◆ softmax_derivatives()

void softmax_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 3 > &  activations_derivatives 
) const
protected

Definition at line 1102 of file layer.cpp.

◆ symmetric_threshold() [1/3]

void symmetric_threshold ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 264 of file layer.cpp.

◆ symmetric_threshold() [2/3]

void symmetric_threshold ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 683 of file layer.cpp.

◆ symmetric_threshold() [3/3]

void symmetric_threshold ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1213 of file layer.cpp.

◆ symmetric_threshold_derivatives() [1/3]

void symmetric_threshold_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 482 of file layer.cpp.

◆ symmetric_threshold_derivatives() [2/3]

void symmetric_threshold_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 937 of file layer.cpp.

◆ symmetric_threshold_derivatives() [3/3]

void symmetric_threshold_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1382 of file layer.cpp.

◆ threshold() [1/3]

void threshold ( const Tensor< type, 1 > &  x,
Tensor< type, 1 > &  y 
) const
protected

Definition at line 250 of file layer.cpp.

◆ threshold() [2/3]

void threshold ( const Tensor< type, 2 > &  x,
Tensor< type, 2 > &  y 
) const
protected

Definition at line 669 of file layer.cpp.

◆ threshold() [3/3]

void threshold ( const Tensor< type, 4 > &  x,
Tensor< type, 4 > &  y 
) const
protected

Definition at line 1199 of file layer.cpp.

◆ threshold_derivatives() [1/3]

void threshold_derivatives ( const Tensor< type, 1 > &  combinations,
Tensor< type, 1 > &  activations,
Tensor< type, 1 > &  activations_derivatives 
) const
protected

Definition at line 460 of file layer.cpp.

◆ threshold_derivatives() [2/3]

void threshold_derivatives ( const Tensor< type, 2 > &  combinations,
Tensor< type, 2 > &  activations,
Tensor< type, 2 > &  activations_derivatives 
) const
protected

Definition at line 913 of file layer.cpp.

◆ threshold_derivatives() [3/3]

void threshold_derivatives ( const Tensor< type, 4 > &  combinations,
Tensor< type, 4 > &  activations,
Tensor< type, 4 > &  activations_derivatives 
) const
protected

Definition at line 1360 of file layer.cpp.

◆ write_expression()

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

◆ write_expression_c()

virtual string write_expression_c ( ) const
inlinevirtual

Reimplemented in BoundingLayer, ScalingLayer, and UnscalingLayer.

Definition at line 168 of file layer.h.

◆ write_expression_python()

virtual string write_expression_python ( ) const
inlinevirtual

Reimplemented in BoundingLayer, and UnscalingLayer.

Definition at line 170 of file layer.h.

◆ write_XML()

virtual void write_XML ( tinyxml2::XMLPrinter ) const
inlinevirtual

Reimplemented in BoundingLayer, ProbabilisticLayer, ScalingLayer, and UnscalingLayer.

Definition at line 162 of file layer.h.

Member Data Documentation

◆ A_B

const Eigen::array<IndexPair<Index>, 1> A_B = {IndexPair<Index>(1, 0)}
protected

Definition at line 274 of file layer.h.

◆ A_BT

const Eigen::array<IndexPair<Index>, 1> A_BT = {IndexPair<Index>(1, 1)}
protected

Definition at line 272 of file layer.h.

◆ AT_B

const Eigen::array<IndexPair<Index>, 1> AT_B = {IndexPair<Index>(0, 0)}
protected

Definition at line 273 of file layer.h.

◆ layer_name

string layer_name = "layer"
protected

Layer name.

Definition at line 179 of file layer.h.

◆ layer_type

Type layer_type = Type::Perceptron
protected

Layer type.

Definition at line 183 of file layer.h.

◆ non_blocking_thread_pool

NonBlockingThreadPool* non_blocking_thread_pool = nullptr
protected

Definition at line 174 of file layer.h.

◆ thread_pool_device

ThreadPoolDevice* thread_pool_device = nullptr
protected

Definition at line 175 of file layer.h.


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