ConvNet  1.0
A GPU-based C++ implementation of Convolutional Neural Nets
 All Classes Namespaces Functions Variables
response_norm_edge.h
1 #ifndef RESPONSE_NORM_EDGE_H_
2 #define RESPONSE_NORM_EDGE_H_
3 #include "edge.h"
4 
7 class ResponseNormEdge : public Edge {
8  public:
9  ResponseNormEdge(const config::Edge& edge_config);
10  virtual void SetTiedTo(Edge* e);
11  virtual void AllocateMemory(bool fprop_only);
12  virtual void ComputeUp(Matrix& input, Matrix& output, bool overwrite);
13  virtual void ComputeDown(Matrix& deriv_output, Matrix& input,
14  Matrix& output, Matrix& deriv_input, bool overwrite);
15  virtual bool RequiresMemoryForDeriv() const { return true; }
16  virtual void SetImageSize(int image_size);
17 
18  bool Blocked() const { return blocked_; }
19  float AddScale() const { return add_scale_; }
20  float PowScale() const { return pow_scale_; }
21  float FracOfFilters() const { return frac_of_filters_response_norm_; }
22 
23  private:
24  Matrix denoms_;
25  int num_filters_response_norm_;
26  bool blocked_;
27  float add_scale_, pow_scale_, frac_of_filters_response_norm_;
28 };
29 #endif
virtual void ComputeUp(Matrix &input, Matrix &output, bool overwrite)
Computes the output layer state given the input.
Definition: response_norm_edge.cc:36
virtual void AllocateMemory(bool fprop_only)
Allocate memory for the model.
Definition: response_norm_edge.cc:26
This class is intended to be used as a base class for implementing edges.
Definition: edge.h:13
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: response_norm_edge.cc:50
A GPU matrix class.
Definition: matrix.h:11
virtual void SetImageSize(int image_size)
Set the spatial size of the input to this edge.
Definition: response_norm_edge.cc:21
Response Normalization across filters at the same location.
Definition: response_norm_edge.h:7
virtual void SetTiedTo(Edge *e)
Sets the edge to be tied to another edge.
Definition: response_norm_edge.cc:12