Wrapper for training schemes based on (iterative) optimization. More...
#include <shark/Algorithms/Trainers/OptimizationTrainer.h>
Public Types | |
typedef base_type::InputType | InputType |
typedef base_type::LabelType | LabelType |
typedef base_type::ModelType | ModelType |
typedef AbstractSingleObjectiveOptimizer< RealVector > | OptimizerType |
typedef AbstractLoss< LabelType, InputType > | LossType |
typedef AbstractStoppingCriterion< SingleObjectiveResultSet< OptimizerType::SearchPointType > > | StoppingCriterionType |
Public Types inherited from shark::AbstractTrainer< Model, LabelTypeT > | |
typedef Model | ModelType |
typedef ModelType::InputType | InputType |
typedef LabelTypeT | LabelType |
typedef LabeledData< InputType, LabelType > | DatasetType |
Public Member Functions | |
OptimizationTrainer (LossType *loss, OptimizerType *optimizer, StoppingCriterionType *stoppingCriterion) | |
std::string | name () const |
From INameable: return the class name. More... | |
void | train (ModelType &model, LabeledData< InputType, LabelType > const &dataset) |
void | read (InArchive &archive) |
Read the component from the supplied archive. More... | |
void | write (OutArchive &archive) const |
Write the component to the supplied archive. More... | |
Public Member Functions inherited from shark::AbstractTrainer< Model, LabelTypeT > | |
virtual void | train (ModelType &model, DatasetType const &dataset)=0 |
Core of the Trainer interface. More... | |
Public Member Functions inherited from shark::INameable | |
virtual | ~INameable () |
Public Member Functions inherited from shark::ISerializable | |
virtual | ~ISerializable () |
Virtual d'tor. More... | |
void | load (InArchive &archive, unsigned int version) |
Versioned loading of components, calls read(...). More... | |
void | save (OutArchive &archive, unsigned int version) const |
Versioned storing of components, calls write(...). More... | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Protected Attributes | |
LossType * | mep_loss |
OptimizerType * | mep_optimizer |
StoppingCriterionType * | mep_stoppingCriterion |
Wrapper for training schemes based on (iterative) optimization.
Definition at line 58 of file OptimizationTrainer.h.
typedef base_type::InputType shark::OptimizationTrainer< Model, LabelTypeT >::InputType |
Definition at line 63 of file OptimizationTrainer.h.
typedef base_type::LabelType shark::OptimizationTrainer< Model, LabelTypeT >::LabelType |
Definition at line 64 of file OptimizationTrainer.h.
typedef AbstractLoss< LabelType, InputType > shark::OptimizationTrainer< Model, LabelTypeT >::LossType |
Definition at line 68 of file OptimizationTrainer.h.
typedef base_type::ModelType shark::OptimizationTrainer< Model, LabelTypeT >::ModelType |
Definition at line 65 of file OptimizationTrainer.h.
typedef AbstractSingleObjectiveOptimizer< RealVector > shark::OptimizationTrainer< Model, LabelTypeT >::OptimizerType |
Definition at line 67 of file OptimizationTrainer.h.
typedef AbstractStoppingCriterion<SingleObjectiveResultSet<OptimizerType::SearchPointType> > shark::OptimizationTrainer< Model, LabelTypeT >::StoppingCriterionType |
Definition at line 69 of file OptimizationTrainer.h.
|
inline |
Definition at line 71 of file OptimizationTrainer.h.
References SHARK_RUNTIME_CHECK.
|
inlinevirtual |
From INameable: return the class name.
Reimplemented from shark::INameable.
Definition at line 83 of file OptimizationTrainer.h.
References shark::OptimizationTrainer< Model, LabelTypeT >::mep_loss, shark::OptimizationTrainer< Model, LabelTypeT >::mep_optimizer, and shark::INameable::name().
Referenced by main().
|
inlinevirtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Definition at line 102 of file OptimizationTrainer.h.
|
inline |
Definition at line 90 of file OptimizationTrainer.h.
References shark::AbstractSingleObjectiveOptimizer< PointType >::init(), shark::ErrorFunction::init(), shark::OptimizationTrainer< Model, LabelTypeT >::mep_loss, shark::OptimizationTrainer< Model, LabelTypeT >::mep_optimizer, shark::OptimizationTrainer< Model, LabelTypeT >::mep_stoppingCriterion, shark::ResultSet< SearchPointT, ResultT >::point, shark::AbstractStoppingCriterion< ResultSetT >::reset(), shark::AbstractSingleObjectiveOptimizer< PointType >::solution(), shark::AbstractOptimizer< PointType, ResultT, SolutionTypeT >::step(), and shark::AbstractStoppingCriterion< ResultSetT >::stop().
Referenced by experiment(), and main().
|
inlinevirtual |
Write the component to the supplied archive.
[in,out] | archive | The archive to write to. |
Reimplemented from shark::ISerializable.
Definition at line 105 of file OptimizationTrainer.h.
|
protected |
Definition at line 109 of file OptimizationTrainer.h.
Referenced by shark::OptimizationTrainer< Model, LabelTypeT >::name(), and shark::OptimizationTrainer< Model, LabelTypeT >::train().
|
protected |
Definition at line 110 of file OptimizationTrainer.h.
Referenced by shark::OptimizationTrainer< Model, LabelTypeT >::name(), and shark::OptimizationTrainer< Model, LabelTypeT >::train().
|
protected |
Definition at line 111 of file OptimizationTrainer.h.
Referenced by shark::OptimizationTrainer< Model, LabelTypeT >::train().