Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
RoberLopez committed Dec 3, 2024
1 parent a3c95ea commit 3019c4e
Show file tree
Hide file tree
Showing 69 changed files with 516 additions and 536 deletions.
16 changes: 8 additions & 8 deletions opennn/adaptive_moment_estimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AdaptiveMomentEstimation : public OptimizationAlgorithm

public:

explicit AdaptiveMomentEstimation(LossIndex* = nullptr);
AdaptiveMomentEstimation(LossIndex* = nullptr);

const type& get_learning_rate() const;
const type& get_beta_1() const;
Expand All @@ -41,7 +41,7 @@ class AdaptiveMomentEstimation : public OptimizationAlgorithm

void set_batch_samples_number(const Index& new_batch_samples_number);

void set_default() final;
void set_default() override;

// Get

Expand All @@ -67,17 +67,17 @@ class AdaptiveMomentEstimation : public OptimizationAlgorithm

// Training

TrainingResults perform_training() final;
TrainingResults perform_training() override;

string write_optimization_algorithm_type() const final;
string write_optimization_algorithm_type() const override;

// Serialization

Tensor<string, 2> to_string_matrix() const final;
Tensor<string, 2> to_string_matrix() const override;

void from_XML(const XMLDocument&) final;
void from_XML(const XMLDocument&) override;

void to_XML(XMLPrinter&) const final;
void to_XML(XMLPrinter&) const override;

void update_parameters(BackPropagation&, AdaptiveMomentEstimationData&) const;

Expand Down Expand Up @@ -120,7 +120,7 @@ class AdaptiveMomentEstimation : public OptimizationAlgorithm

struct AdaptiveMomentEstimationData : public OptimizationAlgorithmData
{
explicit AdaptiveMomentEstimationData(AdaptiveMomentEstimation* = nullptr);
AdaptiveMomentEstimationData(AdaptiveMomentEstimation* = nullptr);

void set(AdaptiveMomentEstimation* = nullptr);

Expand Down
30 changes: 15 additions & 15 deletions opennn/addition_layer_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ class AdditionLayer3D : public Layer

public:

explicit AdditionLayer3D(const Index& = 0, const Index& = 0);
AdditionLayer3D(const Index& = 0, const Index& = 0);

Index get_inputs_number_xxx() const;
Index get_inputs_depth() const;

// @todo
dimensions get_input_dimensions() const final
dimensions get_input_dimensions() const override
{
throw runtime_error("XXX");
}

dimensions get_output_dimensions() const final;
dimensions get_output_dimensions() const override;

void set(const Index& = 0, const Index& = 0);

Expand All @@ -44,15 +44,15 @@ class AdditionLayer3D : public Layer

void forward_propagate(const vector<pair<type*, dimensions>>&,
unique_ptr<LayerForwardPropagation>&,
const bool&) final;
const bool&) override;

void back_propagate(const vector<pair<type*, dimensions>>&,
const vector<pair<type*, dimensions>>&,
unique_ptr<LayerForwardPropagation>&,
unique_ptr<LayerBackPropagation>&) const final;
unique_ptr<LayerBackPropagation>&) const override;

void from_XML(const XMLDocument&) final;
void to_XML(XMLPrinter&) const final;
void from_XML(const XMLDocument&) override;
void to_XML(XMLPrinter&) const override;

#ifdef OPENNN_CUDA
#include "../../opennn_cuda/opennn_cuda/addition_layer_3d_cuda.h"
Expand All @@ -68,27 +68,27 @@ class AdditionLayer3D : public Layer

struct AdditionLayer3DForwardPropagation : LayerForwardPropagation
{
explicit AdditionLayer3DForwardPropagation(const Index& = 0, Layer* new_layer = nullptr);
AdditionLayer3DForwardPropagation(const Index& = 0, Layer* new_layer = nullptr);

pair<type*, dimensions> get_outputs_pair() const final;
pair<type*, dimensions> get_outputs_pair() const override;

void set(const Index& = 0, Layer* = nullptr) final;
void set(const Index& = 0, Layer* = nullptr) override;

void print() const;
void print() const override;

Tensor<type, 3> outputs;
};


struct AdditionLayer3DBackPropagation : LayerBackPropagation
{
explicit AdditionLayer3DBackPropagation(const Index& = 0, Layer* = nullptr);
AdditionLayer3DBackPropagation(const Index& = 0, Layer* = nullptr);

vector<pair<type*, dimensions>> get_input_derivative_pairs() const;
vector<pair<type*, dimensions>> get_input_derivative_pairs() const override;

void set(const Index& = 0, Layer* = nullptr) final;
void set(const Index& = 0, Layer* = nullptr) override;

void print() const;
void print() const override;

Tensor<type, 3> input_1_derivatives;
Tensor<type, 3> input_2_derivatives;
Expand Down
2 changes: 1 addition & 1 deletion opennn/auto_association_data_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AutoAssociativeDataSet : public DataSet

public:

explicit AutoAssociativeDataSet();
AutoAssociativeDataSet();

vector<RawVariable> get_associative_raw_variables() const;
const Tensor<type, 2>& get_associative_data() const;
Expand Down
2 changes: 1 addition & 1 deletion opennn/auto_associative_neural_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AutoAssociativeNeuralNetwork : public NeuralNetwork

public:

explicit AutoAssociativeNeuralNetwork();
AutoAssociativeNeuralNetwork();

BoxPlot get_auto_associative_distances_box_plot() const;
Descriptives get_distance_descriptives() const;
Expand Down
24 changes: 12 additions & 12 deletions opennn/bounding_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class BoundingLayer : public Layer

public:

explicit BoundingLayer(const dimensions& = {0}, const string& = "bounding_layer");
BoundingLayer(const dimensions& = {0}, const string& = "bounding_layer");

enum class BoundingMethod{NoBounding, Bounding};

dimensions get_input_dimensions() const final;
dimensions get_output_dimensions() const final;
dimensions get_input_dimensions() const override;
dimensions get_output_dimensions() const override;

const BoundingMethod& get_bounding_method() const;

Expand All @@ -40,8 +40,8 @@ class BoundingLayer : public Layer

void set(const dimensions & = { 0 }, const string & = "bounding_layer");

void set_input_dimensions(const dimensions&) final;
void set_output_dimensions(const dimensions&) final;
void set_input_dimensions(const dimensions&) override;
void set_output_dimensions(const dimensions&) override;

void set_bounding_method(const BoundingMethod&);
void set_bounding_method(const string&);
Expand All @@ -56,19 +56,19 @@ class BoundingLayer : public Layer

void forward_propagate(const vector<pair<type*, dimensions>>&,
unique_ptr<LayerForwardPropagation>&,
const bool&) final;
const bool&) override;

// Expression

string get_expression(const vector<string>& = vector<string>(), const vector<string>& = vector<string>()) const final;
string get_expression(const vector<string>& = vector<string>(), const vector<string>& = vector<string>()) const override;

// Serialization

void print() const;

void from_XML(const XMLDocument&) final;
void from_XML(const XMLDocument&) override;

void to_XML(XMLPrinter&) const final;
void to_XML(XMLPrinter&) const override;

private:

Expand All @@ -82,11 +82,11 @@ class BoundingLayer : public Layer

struct BoundingLayerForwardPropagation : LayerForwardPropagation
{
explicit BoundingLayerForwardPropagation(const Index& = 0, Layer* = nullptr);
BoundingLayerForwardPropagation(const Index& = 0, Layer* = nullptr);

pair<type*, dimensions> get_outputs_pair() const final;
pair<type*, dimensions> get_outputs_pair() const override;

void set(const Index& = 0, Layer* = nullptr) final;
void set(const Index& = 0, Layer* = nullptr) override;

void print() const;

Expand Down
10 changes: 5 additions & 5 deletions opennn/box_plot.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ namespace opennn

struct BoxPlot
{
explicit BoxPlot(const type& = type(NAN),
const type& = type(NAN),
const type& = type(NAN),
const type& = type(NAN),
const type& = type(NAN));
BoxPlot(const type& = type(NAN),
const type& = type(NAN),
const type& = type(NAN),
const type& = type(NAN),
const type& = type(NAN));

void set(const type& = type(NAN),
const type& = type(NAN),
Expand Down
18 changes: 9 additions & 9 deletions opennn/conjugate_gradient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ConjugateGradient : public OptimizationAlgorithm

enum class TrainingDirectionMethod{PR, FR};

explicit ConjugateGradient(LossIndex* = nullptr);
ConjugateGradient(LossIndex* = nullptr);

// Get

Expand All @@ -46,9 +46,9 @@ class ConjugateGradient : public OptimizationAlgorithm

// Set

void set_default() final;
void set_default() override;

void set_loss_index(LossIndex*) final;
void set_loss_index(LossIndex*) override;

// Training operators

Expand Down Expand Up @@ -81,17 +81,17 @@ class ConjugateGradient : public OptimizationAlgorithm

// Training

TrainingResults perform_training() final;
TrainingResults perform_training() override;

string write_optimization_algorithm_type() const final;
string write_optimization_algorithm_type() const override;

// Serialization

Tensor<string, 2> to_string_matrix() const final;
Tensor<string, 2> to_string_matrix() const override;

void from_XML(const XMLDocument&) final;
void from_XML(const XMLDocument&) override;

void to_XML(XMLPrinter&) const final;
void to_XML(XMLPrinter&) const override;

void update_parameters(
const Batch&,
Expand Down Expand Up @@ -123,7 +123,7 @@ class ConjugateGradient : public OptimizationAlgorithm

struct ConjugateGradientData : public OptimizationAlgorithmData
{
explicit ConjugateGradientData(ConjugateGradient* = nullptr);
ConjugateGradientData(ConjugateGradient* = nullptr);

void set(ConjugateGradient* = nullptr);

Expand Down
36 changes: 18 additions & 18 deletions opennn/convolutional_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class ConvolutionalLayer : public Layer

enum class ConvolutionType{Valid, Same};

explicit ConvolutionalLayer(const dimensions& = {3, 3, 1}, // Input dimensions {height,width,channels}
const dimensions& = {3, 3, 1, 1}, // Kernel dimensions {kernel_height,kernel_width,channels,kernels_number}
const ActivationFunction& = ActivationFunction::Linear,
const dimensions& = { 1, 1 }, // Stride dimensions {row_stride,column_stride}
const ConvolutionType& = ConvolutionType::Valid, // Convolution type (Valid || Same)
const string = "convolutional_layer");
ConvolutionalLayer(const dimensions& = {3, 3, 1}, // Input dimensions {height,width,channels}
const dimensions& = {3, 3, 1, 1}, // Kernel dimensions {kernel_height,kernel_width,channels,kernels_number}
const ActivationFunction& = ActivationFunction::Linear,
const dimensions& = { 1, 1 }, // Stride dimensions {row_stride,column_stride}
const ConvolutionType& = ConvolutionType::Valid, // Convolution type (Valid || Same)
const string = "convolutional_layer");

bool get_batch_normalization() const;

Expand Down Expand Up @@ -81,8 +81,8 @@ class ConvolutionalLayer : public Layer
Index get_input_height() const;
Index get_input_width() const;

Tensor<type, 1> get_parameters() const final;
Index get_parameters_number() const final;
Tensor<type, 1> get_parameters() const override;
Index get_parameters_number() const override;

// Set

Expand Down Expand Up @@ -131,21 +131,21 @@ class ConvolutionalLayer : public Layer

void forward_propagate(const vector<pair<type*, dimensions>>&,
unique_ptr<LayerForwardPropagation>&,
const bool&) final;
const bool&) override;

// Back propagation

void back_propagate(const vector<pair<type*, dimensions>>&,
const vector<pair<type*, dimensions>>&,
unique_ptr<LayerForwardPropagation>&,
unique_ptr<LayerBackPropagation>&) const final;
unique_ptr<LayerBackPropagation>&) const override;

void insert_gradient(unique_ptr<LayerBackPropagation>&,
const Index&,
Tensor<type, 1>&) const final;
Tensor<type, 1>&) const override;

void from_XML(const XMLDocument&) final;
void to_XML(XMLPrinter&) const final;
void from_XML(const XMLDocument&) override;
void to_XML(XMLPrinter&) const override;

void print() const override;

Expand Down Expand Up @@ -197,11 +197,11 @@ class ConvolutionalLayer : public Layer
struct ConvolutionalLayerForwardPropagation : LayerForwardPropagation
{

explicit ConvolutionalLayerForwardPropagation(const Index& = 0, Layer* = nullptr);
ConvolutionalLayerForwardPropagation(const Index& = 0, Layer* = nullptr);

pair<type*, dimensions> get_outputs_pair() const final;
pair<type*, dimensions> get_outputs_pair() const override;

void set(const Index& = 0, Layer* = nullptr) final;
void set(const Index& = 0, Layer* = nullptr) override;

void print() const;

Expand All @@ -218,11 +218,11 @@ struct ConvolutionalLayerForwardPropagation : LayerForwardPropagation

struct ConvolutionalLayerBackPropagation : LayerBackPropagation
{
explicit ConvolutionalLayerBackPropagation(const Index& = 0, Layer* = nullptr);
ConvolutionalLayerBackPropagation(const Index& = 0, Layer* = nullptr);

vector<pair<type*, dimensions>> get_input_derivative_pairs() const;

void set(const Index& = 0, Layer* = nullptr) final;
void set(const Index& = 0, Layer* = nullptr) override;

void print() const;

Expand Down
2 changes: 1 addition & 1 deletion opennn/correlation.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct Correlation

enum class Form{Linear, Logistic, Logarithmic, Exponential, Power};

explicit Correlation() {}
Correlation() {}

void set_perfect()
{
Expand Down
Loading

0 comments on commit 3019c4e

Please sign in to comment.