ScalingLayer Class Reference

This class represents a layer of scaling neurons. More...

#include <scaling_layer.h>

Inheritance diagram for ScalingLayer:
Layer

Public Member Functions

 ScalingLayer ()
 
 ScalingLayer (const Index &)
 
 ScalingLayer (const Tensor< Index, 1 > &)
 
 ScalingLayer (const Tensor< Descriptives, 1 > &)
 
virtual ~ScalingLayer ()
 Destructor. More...
 
Tensor< Index, 1 > get_outputs_dimensions () const
 
Index get_inputs_number () const
 Returns the number of inputs. More...
 
Index get_neurons_number () const
 
Tensor< Descriptives, 1 > get_descriptives () const
 
Descriptives get_descriptives (const Index &) const
 
Tensor< type, 1 > get_minimums () const
 Returns a single matrix with the minimums of all scaling neurons. More...
 
Tensor< type, 1 > get_maximums () const
 Returns a single matrix with the maximums of all scaling neurons. More...
 
Tensor< type, 1 > get_means () const
 Returns a single matrix with the means of all scaling neurons. More...
 
Tensor< type, 1 > get_standard_deviations () const
 Returns a single matrix with the standard deviations of all scaling neurons. More...
 
const Tensor< Scaler, 1 > get_scaling_methods () const
 Returns the methods used for scaling. More...
 
Tensor< string, 1 > write_scalers () const
 Returns a vector of strings with the name of the method used for each scaling neuron. More...
 
Tensor< string, 1 > write_scalers_text () const
 
const bool & get_display () const
 
void set ()
 Sets the scaling layer to be empty. More...
 
void set (const Index &)
 
void set (const Tensor< Index, 1 > &)
 
void set (const Tensor< Descriptives, 1 > &)
 
void set (const Tensor< Descriptives, 1 > &, const Tensor< Scaler, 1 > &)
 
void set (const tinyxml2::XMLDocument &)
 
void set_inputs_number (const Index &)
 
void set_neurons_number (const Index &)
 
void set_default ()
 
void set_descriptives (const Tensor< Descriptives, 1 > &)
 
void set_item_descriptives (const Index &, const Descriptives &)
 
void set_minimum (const Index &, const type &)
 
void set_maximum (const Index &, const type &)
 
void set_mean (const Index &, const type &)
 
void set_standard_deviation (const Index &, const type &)
 
void set_min_max_range (const type &min, const type &max)
 
void set_scalers (const Tensor< Scaler, 1 > &)
 
void set_scalers (const Tensor< string, 1 > &)
 
void set_scalers (const Scaler &)
 
void set_scalers (const string &)
 
void set_display (const bool &)
 
bool is_empty () const
 Returns true if the number of scaling neurons is zero, and false otherwise. More...
 
void check_range (const Tensor< type, 1 > &) const
 
Tensor< type, 2 > calculate_outputs (const Tensor< type, 2 > &)
 
Tensor< type, 4 > calculate_outputs (const Tensor< type, 4 > &)
 
string write_no_scaling_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const
 
string write_minimum_maximum_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const
 
string write_mean_standard_deviation_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const
 
string write_standard_deviation_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const
 
string write_expression (const Tensor< string, 1 > &, const Tensor< string, 1 > &) const
 Returns a string with the expression of the inputs scaling process. More...
 
string write_expression_c () const
 write_expression_c More...
 
string write_expression_python () const
 
virtual void from_XML (const tinyxml2::XMLDocument &)
 
void write_XML (tinyxml2::XMLPrinter &) const
 
- Public Member Functions inherited from Layer
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_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_synaptic_weights_number () const
 Returns the number of layer's synaptic weights. More...
 
Type get_type () const
 
string get_type_string () const
 Takes the type of layer used by the model. More...
 

Protected Attributes

Tensor< Index, 1 > input_variables_dimensions
 
Tensor< Descriptives, 1 > descriptives
 Descriptives of input variables. More...
 
Tensor< Scaler, 1 > scalers
 Vector of scaling methods for each variable. More...
 
type min_range
 min and max range for minmaxscaling More...
 
type max_range
 
bool display = true
 Display warning 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

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

Detailed Description

This class represents a layer of scaling neurons.

Scaling layers are included in the definition of a neural network. They are used to normalize variables so they are in an appropriate range for computer processing.

Definition at line 37 of file scaling_layer.h.

Constructor & Destructor Documentation

◆ ScalingLayer() [1/4]

ScalingLayer ( )
explicit

Default constructor. It creates a scaling layer object with no scaling neurons.

Definition at line 17 of file scaling_layer.cpp.

◆ ScalingLayer() [2/4]

ScalingLayer ( const Index &  new_neurons_number)
explicit

Scaling neurons number constructor. This constructor creates a scaling layer with a given size. The members of this object are initialized with the default values.

Parameters
new_neurons_numberNumber of scaling neurons in the layer.

Definition at line 28 of file scaling_layer.cpp.

◆ ScalingLayer() [3/4]

ScalingLayer ( const Tensor< Index, 1 > &  new_inputs_dimensions)
explicit

Definition at line 34 of file scaling_layer.cpp.

◆ ScalingLayer() [4/4]

ScalingLayer ( const Tensor< Descriptives, 1 > &  new_descriptives)
explicit

Descriptives constructor. This constructor creates a scaling layer with given minimums, maximums, means and standard deviations. The rest of members of this object are initialized with the default values.

Parameters
new_descriptivesVector of vectors with the variables descriptives.

Definition at line 45 of file scaling_layer.cpp.

◆ ~ScalingLayer()

~ScalingLayer ( )
virtual

Destructor.

Definition at line 53 of file scaling_layer.cpp.

Member Function Documentation

◆ calculate_outputs() [1/2]

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

Scales some values to produce some scaled values.

Parameters
inputsSet of inputs to the scaling layer.

Reimplemented from Layer.

Definition at line 749 of file scaling_layer.cpp.

◆ calculate_outputs() [2/2]

Tensor< type, 4 > calculate_outputs ( const Tensor< type, 4 > &  inputs)

Definition at line 843 of file scaling_layer.cpp.

◆ check_range()

void check_range ( const Tensor< type, 1 > &  inputs) const

This method chechs whether the inputs to the scaling layer have the right size. If not, it displays an error message and exits the program. It also checks whether the input values are inside the range defined by the minimums and maximum values, and displays a v fg warning message if they are outside.

Parameters
inputsSet of inputs to the scaling layer.

Definition at line 701 of file scaling_layer.cpp.

◆ from_XML()

void from_XML ( const tinyxml2::XMLDocument document)
virtual

Deserializes a TinyXML document into this scaling layer object.

Parameters
documentXML document containing the member data.

Reimplemented from Layer.

Definition at line 1292 of file scaling_layer.cpp.

◆ get_descriptives() [1/2]

Tensor< Descriptives, 1 > get_descriptives ( ) const

Returns all the scaling layer descriptives. The format is a vector of descriptives structures of size the number of scaling neurons.

Definition at line 79 of file scaling_layer.cpp.

◆ get_descriptives() [2/2]

Descriptives get_descriptives ( const Index &  index) const

Returns the descriptives structure of a single scaling neuron.

Parameters
indexNeuron index.

Definition at line 88 of file scaling_layer.cpp.

◆ get_display()

const bool & get_display ( ) const

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

Definition at line 282 of file scaling_layer.cpp.

◆ get_inputs_number()

Index get_inputs_number ( ) const
virtual

Returns the number of inputs.

Reimplemented from Layer.

Definition at line 64 of file scaling_layer.cpp.

◆ get_maximums()

Tensor< type, 1 > get_maximums ( ) const

Returns a single matrix with the maximums of all scaling neurons.

Definition at line 113 of file scaling_layer.cpp.

◆ get_means()

Tensor< type, 1 > get_means ( ) const

Returns a single matrix with the means of all scaling neurons.

Definition at line 130 of file scaling_layer.cpp.

◆ get_minimums()

Tensor< type, 1 > get_minimums ( ) const

Returns a single matrix with the minimums of all scaling neurons.

Definition at line 96 of file scaling_layer.cpp.

◆ get_neurons_number()

Index get_neurons_number ( ) const
virtual

Reimplemented from Layer.

Definition at line 70 of file scaling_layer.cpp.

◆ get_outputs_dimensions()

Tensor< Index, 1 > get_outputs_dimensions ( ) const

Definition at line 58 of file scaling_layer.cpp.

◆ get_scaling_methods()

const Tensor< Scaler, 1 > get_scaling_methods ( ) const

Returns the methods used for scaling.

Definition at line 164 of file scaling_layer.cpp.

◆ get_standard_deviations()

Tensor< type, 1 > get_standard_deviations ( ) const

Returns a single matrix with the standard deviations of all scaling neurons.

Definition at line 147 of file scaling_layer.cpp.

◆ is_empty()

bool is_empty ( ) const

Returns true if the number of scaling neurons is zero, and false otherwise.

Definition at line 680 of file scaling_layer.cpp.

◆ set() [1/6]

void set ( )

Sets the scaling layer to be empty.

Definition at line 290 of file scaling_layer.cpp.

◆ set() [2/6]

void set ( const Index &  new_inputs_number)

Sets a new size in the scaling layer. It also sets the members to their default values.

Definition at line 303 of file scaling_layer.cpp.

◆ set() [3/6]

void set ( const Tensor< Descriptives, 1 > &  new_descriptives)

Sets the size of the scaling layer and the descriptives values.

Parameters
new_descriptivesVector of vectors containing the minimums, maximums, means and standard deviations for the scaling layer. The size of this vector must be 4. The size of each subvector will be the size of the scaling layer.

Definition at line 337 of file scaling_layer.cpp.

◆ set() [4/6]

void set ( const Tensor< Descriptives, 1 > &  new_descriptives,
const Tensor< Scaler, 1 > &  new_scalers 
)

Definition at line 349 of file scaling_layer.cpp.

◆ set() [5/6]

void set ( const Tensor< Index, 1 > &  new_inputs_dimensions)

Definition at line 315 of file scaling_layer.cpp.

◆ set() [6/6]

void set ( const tinyxml2::XMLDocument new_scaling_layer_document)

Sets the scaling layer members from a XML document.

Parameters
new_scaling_layer_documentPointer to a TinyXML document containing the member data.

Definition at line 360 of file scaling_layer.cpp.

◆ set_default()

void set_default ( )

Sets the members to their default value:

  • Minimus: -1 for all unscaling neurons.
  • Maximums: 1 for all unscaling neurons.
  • Means: 0 for all unscaling neurons.
  • Standard deviations 1 for all unscaling neurons.
  • Scaling method: Minimum and maximum.
  • Display: True.

Definition at line 398 of file scaling_layer.cpp.

◆ set_descriptives()

void set_descriptives ( const Tensor< Descriptives, 1 > &  new_descriptives)

Sets all the scaling layer descriptives from a vector descriptives structures. The size of the vector must be equal to the number of scaling neurons in the layer.

Parameters
new_descriptivesScaling layer descriptives.

Definition at line 426 of file scaling_layer.cpp.

◆ set_display()

void set_display ( const bool &  new_display)

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

Parameters
new_displayDisplay value.

Definition at line 672 of file scaling_layer.cpp.

◆ set_inputs_number()

void set_inputs_number ( const Index &  new_inputs_number)
virtual

Reimplemented from Layer.

Definition at line 368 of file scaling_layer.cpp.

◆ set_item_descriptives()

void set_item_descriptives ( const Index &  i,
const Descriptives item_descriptives 
)

Sets the descriptives of a single scaling neuron.

Parameters
iIndex of neuron.
item_descriptivesDescriptives structure for that neuron.

Definition at line 455 of file scaling_layer.cpp.

◆ set_maximum()

void set_maximum ( const Index &  i,
const type &  new_maximum 
)

Sets the maximum value of a given scaling neuron.

Parameters
iIndex of scaling neuron.
new_maximumMaximum value.

Definition at line 475 of file scaling_layer.cpp.

◆ set_mean()

void set_mean ( const Index &  i,
const type &  new_mean 
)

Sets the mean value of a given scaling neuron.

Parameters
iIndex of scaling neuron.
new_meanMean value.

Definition at line 485 of file scaling_layer.cpp.

◆ set_min_max_range()

void set_min_max_range ( const type &  min,
const type &  max 
)

Sets max and min scaling range for minmaxscaling.

Parameters
minand max for scaling range.

Definition at line 415 of file scaling_layer.cpp.

◆ set_minimum()

void set_minimum ( const Index &  i,
const type &  new_minimum 
)

Sets the minimum value of a given scaling neuron.

Parameters
iIndex of scaling neuron.
new_minimumMinimum value.

Definition at line 465 of file scaling_layer.cpp.

◆ set_neurons_number()

void set_neurons_number ( const Index &  new_neurons_number)
virtual

Reimplemented from Layer.

Definition at line 378 of file scaling_layer.cpp.

◆ set_scalers() [1/4]

void set_scalers ( const Scaler &  new_scaling_method)

Sets the method to be used for scaling the variables.

Parameters
new_scaling_methodNew scaling method for the variables.

Definition at line 656 of file scaling_layer.cpp.

◆ set_scalers() [2/4]

void set_scalers ( const string &  new_scaling_methods_string)

Sets all the methods to be used for scaling with the given method. The argument is a string containing the name of the method("NoScaling", "MeanStandardDeviation" or "MinimumMaximum").

Parameters
new_scaling_methods_stringNew scaling methods for the variables.

Definition at line 594 of file scaling_layer.cpp.

◆ set_scalers() [3/4]

void set_scalers ( const Tensor< Scaler, 1 > &  new_scaling_methods)

Sets the methods to be used for scaling each variable.

Parameters
new_scaling_methodsNew scaling methods for the variables.

Definition at line 504 of file scaling_layer.cpp.

◆ set_scalers() [4/4]

void set_scalers ( const Tensor< string, 1 > &  new_scaling_methods_string)

Sets the methods to be used for scaling each variable. The argument is a vector string containing the name of the methods("NoScaling", "MeanStandardDeviation" or "MinimumMaximum").

Parameters
new_scaling_methods_stringNew scaling methods for the variables.

Definition at line 531 of file scaling_layer.cpp.

◆ set_standard_deviation()

void set_standard_deviation ( const Index &  i,
const type &  new_standard_deviation 
)

Sets the standard deviation value of a given scaling neuron.

Parameters
iIndex of scaling neuron.
new_standard_deviationStandard deviation value.

Definition at line 495 of file scaling_layer.cpp.

◆ write_expression()

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

Returns a string with the expression of the inputs scaling process.

Reimplemented from Layer.

Definition at line 1014 of file scaling_layer.cpp.

◆ write_expression_c()

string write_expression_c ( ) const
virtual

write_expression_c

Returns

Reimplemented from Layer.

Definition at line 1065 of file scaling_layer.cpp.

◆ write_expression_python()

string write_expression_python ( ) const
virtual

Reimplemented from Layer.

Definition at line 1127 of file scaling_layer.cpp.

◆ write_mean_standard_deviation_expression()

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

Returns a string with the expression of the scaling process with the mean and standard deviation method.

Parameters
inputs_namesName of inputs to the scaling layer. The size of this vector must be equal to the number of scaling neurons.
outputs_namesName of outputs from the scaling layer. The size of this vector must be equal to the number of scaling neurons.

Definition at line 974 of file scaling_layer.cpp.

◆ write_minimum_maximum_expression()

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

Returns a string with the expression of the scaling process with the minimum and maximum method.

Parameters
inputs_namesName of inputs to the scaling layer. The size of this vector must be equal to the number of scaling neurons.
outputs_namesName of outputs from the scaling layer. The size of this vector must be equal to the number of scaling neurons.

Definition at line 953 of file scaling_layer.cpp.

◆ write_no_scaling_expression()

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

Returns a string with the expression of the scaling process when the none method is used.

Parameters
inputs_namesName of inputs to the scaling layer. The size of this vector must be equal to the number of scaling neurons.
outputs_namesName of outputs from the scaling layer. The size of this vector must be equal to the number of scaling neurons.

Definition at line 932 of file scaling_layer.cpp.

◆ write_scalers()

Tensor< string, 1 > write_scalers ( ) const

Returns a vector of strings with the name of the method used for each scaling neuron.

Definition at line 172 of file scaling_layer.cpp.

◆ write_scalers_text()

Tensor< string, 1 > write_scalers_text ( ) const

Returns a vector of strings with the name of the methods used for scaling, as paragaph text.

Definition at line 219 of file scaling_layer.cpp.

◆ write_standard_deviation_expression()

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

Returns a string with the expression of the scaling process with the standard deviation method.

Parameters
inputs_namesName of inputs to the scaling layer. The size of this vector must be equal to the number of scaling neurons.
outputs_namesName of outputs from the scaling layer. The size of this vector must be equal to the number of scaling neurons.

Definition at line 995 of file scaling_layer.cpp.

◆ write_XML()

void write_XML ( tinyxml2::XMLPrinter file_stream) const
virtual

Serializes the scaling layer object into a XML document of the TinyXML library without keep the DOM tree in memory. See the OpenNN manual for more information about the format of this document.

Reimplemented from Layer.

Definition at line 1190 of file scaling_layer.cpp.

Member Data Documentation

◆ descriptives

Tensor<Descriptives, 1> descriptives
protected

Descriptives of input variables.

Definition at line 158 of file scaling_layer.h.

◆ display

bool display = true
protected

Display warning messages to screen.

Definition at line 171 of file scaling_layer.h.

◆ input_variables_dimensions

Tensor<Index, 1> input_variables_dimensions
protected

Definition at line 154 of file scaling_layer.h.

◆ max_range

type max_range
protected

Definition at line 167 of file scaling_layer.h.

◆ min_range

type min_range
protected

min and max range for minmaxscaling

Definition at line 166 of file scaling_layer.h.

◆ scalers

Tensor<Scaler, 1> scalers
protected

Vector of scaling methods for each variable.

Definition at line 162 of file scaling_layer.h.


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