ConvNet  1.0
A GPU-based C++ implementation of Convolutional Neural Nets
 All Classes Namespaces Functions Variables
maxpool_edge.h
1 #ifndef MAXPOOL_EDGE_H_
2 #define MAXPOOL_EDGE_H_
3 #include "edge.h"
4 
6 class MaxPoolEdge : public Edge {
7  public:
8  MaxPoolEdge(const config::Edge& edge_config);
9  virtual void SetTiedTo(Edge* e);
10  virtual void AllocateMemory(bool fprop_only);
11  virtual void ComputeUp(Matrix& input, Matrix& output, bool overwrite);
12  virtual void ComputeDown(Matrix& deriv_output, Matrix& input,
13  Matrix& output, Matrix& deriv_input, bool overwrite);
14 
15  virtual int GetNumModules() const { return num_modules_; }
16  virtual bool RequiresMemoryForDeriv() const { return true; }
17  virtual void SetImageSize(int image_size);
18 
19  int GetKernelSize() const { return kernel_size_; }
20  int GetStride() const { return stride_; }
21  int GetPadding() const { return padding_; }
22 
23  private:
24  int kernel_size_, stride_, padding_;
25 };
26 #endif
virtual void SetImageSize(int image_size)
Set the spatial size of the input to this edge.
Definition: maxpool_edge.cc:19
virtual void ComputeUp(Matrix &input, Matrix &output, bool overwrite)
Computes the output layer state given the input.
Definition: maxpool_edge.cc:36
This class is intended to be used as a base class for implementing edges.
Definition: edge.h:13
virtual void AllocateMemory(bool fprop_only)
Allocate memory for the model.
Definition: maxpool_edge.cc:24
virtual void ComputeDown(Matrix &deriv_output, Matrix &input, Matrix &output, Matrix &deriv_input, bool overwrite)
Computes the derivative w.r.t the inputs of this edge given the derivative w.r.t the outputs of this ...
Definition: maxpool_edge.cc:45
virtual void SetTiedTo(Edge *e)
Sets the edge to be tied to another edge.
Definition: maxpool_edge.cc:10
A GPU matrix class.
Definition: matrix.h:11
virtual int GetNumModules() const
Returns the number of modules.
Definition: maxpool_edge.h:15
Implements a Max-pool edge.
Definition: maxpool_edge.h:6