# Deep network: src/layers/pooling.hpp Source File

pooling.hpp
Go to the documentation of this file.
#ifndef POOLING_LAYER_HPP
#define POOLING_LAYER_HPP
#include "layer.hpp"
namespace Layer{
class Pooling:public Layer{
public:
size_t nf;
size_t ni;
size_t nj;
size_t p;
size_t q;
size_t mi;
size_t mj;
public:
Pooling(size_t nf,size_t ni,size_t nj,size_t p,size_t q);
~Pooling(){};
Vector feed_forward(Vector x) override;
void init_nabla() override {};
Vector back_propagation(Vector e) override;
void update(Real) override {};
};
inline
Pooling::Pooling(size_t nf_,size_t ni_,size_t nj_,size_t p_,size_t q_):
Layer(nf_*ni_*nj_,nf_*((ni_+p_-1)/p_)*((nj_+q_-1)/q_)){
nf=nf_;
ni=ni_;
nj=nj_;
p=p_;
q=q_;
mi=(ni+p-1)/p;
mj=(nj+q-1)/p;
}
}
#endif
Layer::Layer::x
Vector x
Definition: layer.hpp:32
Layer::Pooling
Definition: pooling.hpp:8
Layer::Pooling::mi
size_t mi
Definition: pooling.hpp:15
Layer::Pooling::nj
size_t nj
Definition: pooling.hpp:12
Layer::Pooling::nf
size_t nf
Definition: pooling.hpp:10
Layer::Pooling::back_propagation
Vector back_propagation(Vector e) override
Definition: pooling.cpp:27
Layer::Pooling::init_nabla
void init_nabla() override
Definition: pooling.hpp:21
Layer::Pooling::mj
size_t mj
Definition: pooling.hpp:16
Layer::Pooling::feed_forward
Vector feed_forward(Vector x) override
Definition: pooling.cpp:6
Layer::Pooling::p
size_t p
Definition: pooling.hpp:13
Layer::Pooling::ni
size_t ni
Definition: pooling.hpp:11
Layer::Pooling::update
void update(Real) override
Definition: pooling.hpp:23
Layer::Pooling::q
size_t q
Definition: pooling.hpp:14
Layer::Pooling::~Pooling
~Pooling()
Definition: pooling.hpp:19
Layer::Pooling::Pooling
Pooling(size_t nf, size_t ni, size_t nj, size_t p, size_t q)
Definition: pooling.hpp:27
layer.hpp
Layer
Definition: activation.hpp:7
Real
double Real
Definition: vector.hpp:9
Vector
Real * Vector
Definition: vector.hpp:45