Caffe
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
caffe::Solver< Dtype > Class Template Referenceabstract

An interface for classes that perform optimization on Nets. More...

#include <solver.hpp>

Inheritance diagram for caffe::Solver< Dtype >:
caffe::SGDSolver< Dtype > caffe::AdaDeltaSolver< Dtype > caffe::AdaGradSolver< Dtype > caffe::AdamSolver< Dtype > caffe::NesterovSolver< Dtype > caffe::RMSPropSolver< Dtype >

Classes

class  Callback
 

Public Member Functions

 Solver (const SolverParameter &param)
 
 Solver (const string &param_file)
 
void Init (const SolverParameter &param)
 
void InitTrainNet ()
 
void InitTestNets ()
 
void SetActionFunction (ActionCallback func)
 
SolverAction::Enum GetRequestedAction ()
 
virtual void Solve (const char *resume_file=NULL)
 
void Solve (const string resume_file)
 
void Step (int iters)
 
void Restore (const char *resume_file)
 
void Snapshot ()
 
const SolverParameter & param () const
 
shared_ptr< Net< Dtype > > net ()
 
const vector< shared_ptr< Net< Dtype > > > & test_nets ()
 
int iter () const
 
const vector< Callback * > & callbacks () const
 
void add_callback (Callback *value)
 
void CheckSnapshotWritePermissions ()
 
virtual const char * type () const
 Returns the solver type.
 

Protected Member Functions

virtual void ApplyUpdate ()=0
 
string SnapshotFilename (const string extension)
 
string SnapshotToBinaryProto ()
 
string SnapshotToHDF5 ()
 
void TestAll ()
 
void Test (const int test_net_id=0)
 
virtual void SnapshotSolverState (const string &model_filename)=0
 
virtual void RestoreSolverStateFromHDF5 (const string &state_file)=0
 
virtual void RestoreSolverStateFromBinaryProto (const string &state_file)=0
 
void DisplayOutputBlobs (const int net_id)
 
void UpdateSmoothedLoss (Dtype loss, int start_iter, int average_loss)
 
 DISABLE_COPY_AND_ASSIGN (Solver)
 

Protected Attributes

SolverParameter param_
 
int iter_
 
int current_step_
 
shared_ptr< Net< Dtype > > net_
 
vector< shared_ptr< Net< Dtype > > > test_nets_
 
vector< Callback * > callbacks_
 
vector< Dtype > losses_
 
Dtype smoothed_loss_
 
ActionCallback action_request_function_
 
bool requested_early_exit_
 
Timer iteration_timer_
 
float iterations_last_
 

Detailed Description

template<typename Dtype>
class caffe::Solver< Dtype >

An interface for classes that perform optimization on Nets.

Requires implementation of ApplyUpdate to compute a parameter update given the current state of the Net parameters.


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