PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions
PLearn::HyperRetrain Class Reference

#include <HyperRetrain.h>

Inheritance diagram for PLearn::HyperRetrain:
Inheritance graph
[legend]
Collaboration diagram for PLearn::HyperRetrain:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual HyperRetraindeepCopy (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 PPathdeclaringFile ()

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares this class' options.

Protected Attributes

PP< Splittersplitter
 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.

Detailed Description

Definition at line 54 of file HyperRetrain.h.


Member Typedef Documentation

Reimplemented from PLearn::HyperCommand.

Definition at line 59 of file HyperRetrain.h.


Constructor & Destructor Documentation

PLearn::HyperRetrain::HyperRetrain ( )

Definition at line 50 of file HyperRetrain.cc.

                          :
    provide_tester_expdir(false),
    call_forget(true)
{}

Member Function Documentation

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.

bool PLearn::HyperRetrain::_isa_ ( const Object o) [static]

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_().

Here is the call graph for this function:

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().

{}

Here is the caller graph for this function:

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);
}

Here is the call graph for this function:

static const PPath& PLearn::HyperRetrain::declaringFile ( ) [inline, static]

Reimplemented from PLearn::HyperCommand.

Definition at line 63 of file HyperRetrain.h.

:
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.

Here is the call graph for this function:

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;
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::HyperCommand.

Definition at line 63 of file HyperRetrain.h.

Definition at line 73 of file HyperRetrain.h.

Referenced by declareOptions(), and optimize().

Whether an expdir should be set into the child tester.

Definition at line 71 of file HyperRetrain.h.

Referenced by declareOptions(), and optimize().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines