ConvNet  1.0
A GPU-based C++ implementation of Convolutional Neural Nets
 All Classes Namespaces Functions Variables
Public Member Functions | Protected Member Functions | List of all members
GradChecker Class Reference
Inheritance diagram for GradChecker:
ConvNet

Public Member Functions

 GradChecker (const string &model_file)
 
void Run ()
 
void Run (Matrix &w, Matrix &dLbydw_analytical, float epsilon, const vector< float > &analytical_error)
 
- Public Member Functions inherited from ConvNet
 ConvNet (const string &model_file)
 Instantiate a model using the config in model_file.
 
void SetupDataset (const string &train_data_config_file)
 
virtual void SetupDataset (const string &train_data_config_file, const string &val_data_config_file)
 
virtual void Train ()
 Start training. More...
 
void Validate (DataHandler *dataset, vector< float > &error)
 Validate the model on the specfied dataset and return the error. More...
 
void Validate (vector< float > &error)
 Validate the model on the validation dataset and return the error. More...
 
void Save ()
 Write the model to disk. More...
 
void Save (const string &output_file)
 Write the model to disk in the file specified. More...
 
void Load ()
 Load the model. More...
 
void Load (const string &input_file)
 Load the model from the file specified. More...
 
void Display ()
 Display the state of the model. More...
 
void DumpOutputs (const string &output_file, DataHandler *dataset, const vector< string > &layer_names)
 Write the state of the layers to disk. More...
 
void DumpOutputs (const string &output_file, const vector< string > &layer_names)
 Write the state of the layers to disk. More...
 
void AllocateMemory (bool fprop_only)
 Allocate memory for the model. More...
 

Protected Member Functions

virtual void GetLoss (vector< float > &error)
 Computes the loss function (to be displayed). More...
 
- Protected Member Functions inherited from ConvNet
void BuildNet ()
 Creates layers and edges. More...
 
void DestroyNet ()
 Release all memory held by the model. More...
 
void AllocateLayerMemory ()
 Allocate layer memory for using mini-batches of batch_size_. More...
 
void AllocateEdgeMemory (bool fprop_only)
 Allocate memory for edges. More...
 
string GetCheckpointFilename ()
 
void TimestampModel ()
 
void Sort ()
 Topologically sort layers. More...
 
void Fprop (Layer &input, Layer &output, Edge &edge, bool overwrite)
 Forward propagate one layer. More...
 
virtual void Bprop (Layer &output, Layer &input, Edge &edge, bool overwrite, bool update_weights)
 Back propagate through one layer. More...
 
virtual void Fprop (bool train)
 Forward propagate through the network. More...
 
virtual void Bprop (bool update_weights)
 Backpropagate through the network and update weights. More...
 
virtual void ComputeDeriv ()
 Computes the derivative of the loss function. More...
 
void DumpOutputs (const string &output_file, DataHandler *dataset, vector< Layer * > &layers)
 Write the state of the layers to disk. More...
 
virtual void TrainOneBatch (vector< float > &error)
 Takes one optimization step. More...
 
void DisplayLayers ()
 
void DisplayEdges ()
 
void InsertPolyak ()
 
void LoadPolyakWeights ()
 
void LoadCurrentWeights ()
 
void WriteLog (int current_iter, float time, float training_error)
 
void WriteLog (int current_iter, float time, const vector< float > &training_error)
 
void WriteValLog (int current_iter, const vector< float > &error)
 
LayerGetLayerByName (const string &name)
 
bool CheckReduceLearningRate (const vector< float > &val_error)
 Decides if learning rate should be reduced. More...
 
void ReduceLearningRate (const float factor)
 Multiply learning rate by factor. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from ConvNet
static void AddVectors (vector< float > &a, vector< float > &b)
 
- Protected Attributes inherited from ConvNet
config::Model model_
 
vector< Layer * > layers_
 The model protobuf config. More...
 
vector< Layer * > data_layers_
 The layers in the network. More...
 
vector< Layer * > input_layers_
 Layers which have data associated with them. More...
 
vector< Layer * > output_layers_
 Input layers. More...
 
vector< Edge * > edges_
 Output layers. More...
 
int max_iter_
 The edges in the network. More...
 
int batch_size_
 
int current_iter_
 
int lr_reduce_counter_
 
DataHandlertrain_dataset_
 
DataHandlerval_dataset_
 
string checkpoint_dir_
 
string output_file_
 
string model_name_
 
ImageDisplayer displayer_
 
string model_filename_
 
string timestamp_
 
string log_file_
 
string val_log_file_
 

Member Function Documentation

void GradChecker::GetLoss ( vector< float > &  error)
protectedvirtual

Computes the loss function (to be displayed).

Reimplemented from ConvNet.


The documentation for this class was generated from the following files: