16 Edge(
const config::Edge& edge_config);
37 virtual void InsertPolyak();
38 virtual void BackupCurrent();
39 virtual void LoadCurrentOnGPU();
40 virtual void LoadPolyakOnGPU();
100 void SetSource(
Layer* source);
101 void SetDest(
Layer* dest);
104 const string& GetSourceName();
105 const string& GetDestName();
106 const string& GetName();
115 string GetTiedEdgeName();
117 int GetGPUId()
const {
return gpu_id_; }
120 void ComputeStart(
Matrix& mat);
121 void ComputeEnd(
Matrix& mat);
131 int num_input_channels_, num_output_channels_, image_size_, num_modules_;
const bool block_backprop_
A marker.
Definition: edge.h:133
Layer * dest_
The source layer for this edge.
Definition: edge.h:128
The base class for all layers.
Definition: layer.h:9
virtual void DisplayWeights()
Displays the weights.
Definition: edge.cc:110
virtual void Initialize()
Initialize the weights and biases.
Definition: edge.cc:99
void SetInputChannels(int a)
Set the number of input channels.
Definition: edge.cc:81
static Edge * ChooseEdgeClass(const config::Edge &edge_config)
Selects the appropriate derived class for the edge config.
Definition: edge.cc:17
virtual void ReduceLearningRate(float factor)
Reduce the learning rate by factor.
Definition: edge.cc:118
virtual void SetImageSize(int image_size)
Set the spatial size of the input to this edge.
Definition: edge.cc:191
This class is intended to be used as a base class for implementing edges.
Definition: edge.h:13
void SetOutputChannels(int a)
Set the number of output channels.
Definition: edge.cc:85
const string source_node_
The destination layer for this edge.
Definition: edge.h:129
virtual void UpdateWeights()
Update the weights.
Definition: edge.cc:126
virtual void LoadParameters(hid_t file)
Load the weights and biases from an hdf5 file.
Definition: edge.cc:94
virtual int GetNumModules() const
Returns the number of modules.
Definition: edge.cc:174
virtual float GetRMSWeight()
Returns the root mean square weight value.
Definition: edge.cc:130
virtual void AllocateMemory(bool fprop_only)
Allocate memory for the model.
Definition: edge.cc:103
A GPU matrix class.
Definition: matrix.h:11
bool IsBackPropBlocked() const
Returns whether back prop is blocked through this edge.
Definition: edge.h:98
virtual void SaveParameters(hid_t file)
Write the weights and biases in an hdf5 file.
Definition: edge.cc:89
Edge(const config::Edge &edge_config)
Instatntiate an Edge from the config.
Definition: edge.cc:54
virtual void ComputeDown(Matrix &deriv_output, Matrix &input, Matrix &output, Matrix &deriv_input, bool overwrite)=0
Computes the derivative w.r.t the inputs of this edge given the derivative w.r.t the outputs of this ...
virtual void ComputeUp(Matrix &input, Matrix &output, bool overwrite)=0
Computes the output layer state given the input.
virtual bool HasNoParameters() const
Returns whether the edge has any parameters.
Definition: edge.cc:170
virtual void SetTiedTo(Edge *e)
Sets the edge to be tied to another edge.
Definition: edge.cc:77
virtual void ComputeOuter(Matrix &input, Matrix &deriv_output)
Computes the gradient for the weights and biases.
Definition: edge.cc:122
virtual void DisplayWeightStats()
Displays the statistics of the weights.
Definition: edge.cc:114