PLearn 0.1
|
#include <HyperRetrain.h>
Public Member Functions | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual HyperRetrain * | deepCopy (CopiesMap &copies) const |
HyperRetrain () | |
virtual void | build () |
Post-constructor. | |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Transforms a shallow copy into a deep copy. | |
virtual Vec | optimize () |
Executes the command, returning the resulting costvec of its optimization (or an empty vec if it didn't do any testng). | |
virtual TVec< string > | getResultNames () const |
Returns the names of the results returned by the optimize() method. | |
Static Public Member Functions | |
static string | _classname_ () |
static OptionList & | _getOptionList_ () |
static RemoteMethodMap & | _getRemoteMethodMap_ () |
static Object * | _new_instance_for_typemap_ () |
static bool | _isa_ (const Object *o) |
static void | _static_initialize_ () |
static const PPath & | declaringFile () |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Protected Attributes | |
PP< Splitter > | splitter |
New splitter to use in order to retrain; if not specified, use the enclosing PTester splitter. | |
bool | provide_tester_expdir |
Whether an expdir should be set into the child tester. | |
bool | call_forget |
Private Types | |
typedef HyperCommand | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 54 of file HyperRetrain.h.
typedef HyperCommand PLearn::HyperRetrain::inherited [private] |
Reimplemented from PLearn::HyperCommand.
Definition at line 59 of file HyperRetrain.h.
PLearn::HyperRetrain::HyperRetrain | ( | ) |
Definition at line 50 of file HyperRetrain.cc.
: provide_tester_expdir(false), call_forget(true) {}
string PLearn::HyperRetrain::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::HyperCommand.
Definition at line 67 of file HyperRetrain.cc.
OptionList & PLearn::HyperRetrain::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::HyperCommand.
Definition at line 67 of file HyperRetrain.cc.
RemoteMethodMap & PLearn::HyperRetrain::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::HyperCommand.
Definition at line 67 of file HyperRetrain.cc.
Reimplemented from PLearn::HyperCommand.
Definition at line 67 of file HyperRetrain.cc.
Object * PLearn::HyperRetrain::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 67 of file HyperRetrain.cc.
StaticInitializer HyperRetrain::_static_initializer_ & PLearn::HyperRetrain::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::HyperCommand.
Definition at line 67 of file HyperRetrain.cc.
void PLearn::HyperRetrain::build | ( | ) | [virtual] |
Post-constructor.
The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.
Reimplemented from PLearn::HyperCommand.
Definition at line 103 of file HyperRetrain.cc.
References PLearn::HyperCommand::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::HyperRetrain::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::HyperCommand.
Definition at line 97 of file HyperRetrain.cc.
Referenced by build().
{}
string PLearn::HyperRetrain::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 67 of file HyperRetrain.cc.
void PLearn::HyperRetrain::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::HyperCommand.
Definition at line 72 of file HyperRetrain.cc.
References PLearn::OptionBase::buildoption, call_forget, PLearn::declareOption(), PLearn::HyperCommand::declareOptions(), provide_tester_expdir, and splitter.
{ declareOption(ol, "splitter", &HyperRetrain::splitter, OptionBase::buildoption, "Splitter to use for (re)training. If not provided, the current\n" "splitter will be used."); declareOption(ol, "provide_tester_expdir", &HyperRetrain::provide_tester_expdir, OptionBase::buildoption, "Should the tester be provided with an expdir for retraining."); declareOption(ol, "call_forget", &HyperRetrain::call_forget, OptionBase::buildoption, "Whether to call forget() before training. Note that even if set to\n" "0, forget() might be called in setTrainingSet(..) if a new splitter\n" "is provided."); // Now call the parent class' declareOptions inherited::declareOptions(ol); }
static const PPath& PLearn::HyperRetrain::declaringFile | ( | ) | [inline, static] |
HyperRetrain * PLearn::HyperRetrain::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::HyperCommand.
Definition at line 67 of file HyperRetrain.cc.
OptionList & PLearn::HyperRetrain::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 67 of file HyperRetrain.cc.
OptionMap & PLearn::HyperRetrain::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 67 of file HyperRetrain.cc.
RemoteMethodMap & PLearn::HyperRetrain::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 67 of file HyperRetrain.cc.
TVec< string > PLearn::HyperRetrain::getResultNames | ( | ) | const [virtual] |
Returns the names of the results returned by the optimize() method.
Implements PLearn::HyperCommand.
Definition at line 145 of file HyperRetrain.cc.
References PLearn::HyperCommand::hlearner, and PLearn::HyperLearner::tester.
{ return hlearner->tester->getStatNames(); }
void PLearn::HyperRetrain::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::HyperCommand.
Definition at line 112 of file HyperRetrain.cc.
References PLearn::deepCopyField(), PLearn::HyperCommand::makeDeepCopyFromShallowCopy(), and splitter.
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(splitter, copies); }
Vec PLearn::HyperRetrain::optimize | ( | ) | [virtual] |
Executes the command, returning the resulting costvec of its optimization (or an empty vec if it didn't do any testng).
Implements PLearn::HyperCommand.
Definition at line 121 of file HyperRetrain.cc.
References call_forget, PLearn::HyperCommand::expdir, PLearn::HyperCommand::hlearner, PLearn::PP< T >::isNull(), provide_tester_expdir, splitter, and PLearn::HyperLearner::tester.
{ PP<PTester> tester = hlearner->tester; string testerexpdir = ""; if(expdir!="" && provide_tester_expdir) testerexpdir = expdir+"retrain/"; tester->setExperimentDirectory(testerexpdir); PP<Splitter> default_splitter = tester->splitter; if (!splitter.isNull()) tester->splitter = splitter; Vec results = tester->perform(call_forget); // restore default splitter tester->splitter = default_splitter; return results; }
Reimplemented from PLearn::HyperCommand.
Definition at line 63 of file HyperRetrain.h.
bool PLearn::HyperRetrain::call_forget [protected] |
Definition at line 73 of file HyperRetrain.h.
Referenced by declareOptions(), and optimize().
bool PLearn::HyperRetrain::provide_tester_expdir [protected] |
Whether an expdir should be set into the child tester.
Definition at line 71 of file HyperRetrain.h.
Referenced by declareOptions(), and optimize().
PP<Splitter> PLearn::HyperRetrain::splitter [protected] |
New splitter to use in order to retrain; if not specified, use the enclosing PTester splitter.
Definition at line 63 of file HyperRetrain.h.
Referenced by declareOptions(), makeDeepCopyFromShallowCopy(), and optimize().