27#include "statistics.h"
29#include "perceptron_layer.h"
30#include "convolutional_layer.h"
53 explicit PoolingLayer(
const Tensor<Index, 1>&,
const Tensor<Index, 1>&);
96 void set_inputs_number(
const Index&) {}
97 void set_neurons_number(
const Index&) {}
117 void calculate_activations(
const Tensor<type, 4>&, Tensor<type, 4>&) {}
127 Tensor<type, 2> calculate_activations_derivatives(
const Tensor<type, 2>&)
const;
129 void calculate_activations_derivatives(
const Tensor<type, 2>&, Tensor<type, 2>&)
const
136 void forward_propagate(
const Tensor<type, 4>&, LayerForwardPropagation*)
142 Tensor<type, 4> calculate_hidden_delta(Layer*,
const Tensor<type, 4>&,
const Tensor<type, 4>&,
const Tensor<type, 4>&)
const;
144 Tensor<type, 4> calculate_hidden_delta_convolutional(ConvolutionalLayer*,
const Tensor<type, 4>&,
const Tensor<type, 4>&,
const Tensor<type, 4>&)
const;
145 Tensor<type, 4> calculate_hidden_delta_pooling(
PoolingLayer*,
const Tensor<type, 4>&,
const Tensor<type, 4>&,
const Tensor<type, 4>&)
const;
146 Tensor<type, 4> calculate_hidden_delta_perceptron(PerceptronLayer*,
const Tensor<type, 4>&,
const Tensor<type, 4>&,
const Tensor<type, 4>&)
const;
147 Tensor<type, 4> calculate_hidden_delta_probabilistic(ProbabilisticLayer*,
const Tensor<type, 4>&,
const Tensor<type, 4>&,
const Tensor<type, 4>&)
const;
151 Tensor<type, 1> calculate_error_gradient(
const Tensor<type, 2>&,
const LayerForwardPropagation&,
const Tensor<type, 2>&);
155 Tensor<Index, 1> input_variables_dimensions;
157 Index pool_rows_number = 2;
159 Index pool_columns_number = 2;
161 Index padding_width = 0;
163 Index row_stride = 1;
165 Index column_stride = 1;
167 PoolingMethod pooling_method = PoolingMethod::AveragePooling;
170 #include "../../opennn-cuda/opennn-cuda/pooling_layer_cuda.h"
This abstract class represents the concept of layer of neurons in OpenNN.
void set_input_variables_dimensions(const Tensor< Index, 1 > &)
virtual ~PoolingLayer()
Destructor.
Tensor< type, 4 > calculate_max_pooling_outputs(const Tensor< type, 4 > &) const
Tensor< type, 4 > calculate_average_pooling_outputs(const Tensor< type, 4 > &) const
Index get_column_stride() const
Returns the pooling filter's column stride.
Index get_inputs_number() const
Returns the number of inputs of the layer.
Tensor< type, 4 > calculate_outputs(const Tensor< type, 4 > &)
Index get_outputs_rows_number() const
Returns the number of rows of the layer's output.
void set_pooling_method(const PoolingMethod &)
void set_default()
Sets the layer type to Layer::Pooling.
Index get_inputs_channels_number() const
Returns the number of channels of the layers' input.
Tensor< type, 4 > calculate_no_pooling_outputs(const Tensor< type, 4 > &) const
Index get_pool_rows_number() const
Returns the number of rows of the pooling filter.
Index get_inputs_rows_number() const
Returns the number of rows of the layer's input.
Index get_inputs_columns_number() const
Returns the number of columns of the layer's input.
void set_row_stride(const Index &)
Index get_outputs_columns_number() const
Returns the number of columns of the layer's output.
void set_pool_size(const Index &, const Index &)
void set_column_stride(const Index &)
PoolingMethod
Enumeration of available methods for pooling data.
Index get_padding_width() const
Returns the padding width.
Index get_neurons_number() const
Returns the number of neurons the layer applies to an image.
void set_padding_width(const Index &)
Tensor< Index, 1 > get_outputs_dimensions() const
Returns the layer's outputs dimensions.
Index get_row_stride() const
Returns the pooling filter's row stride.
PoolingMethod get_pooling_method() const
Returns the pooling method.
Index get_parameters_number() const
Returns the number of parameters of the layer.
Index get_pool_columns_number() const
Returns the number of columns of the pooling filter.
Tensor< type, 1 > get_parameters() const
Returns the layer's parameters.