|
PLearn 0.1
|
The first sentence should be a BRIEF DESCRIPTION of what the class does. More...
#include <Stan.h>


Public Member Functions | |
| Stan () | |
| virtual void | run (const std::vector< std::string > &args) |
| The actual implementation of the 'Stan' command. | |
Static Protected Attributes | |
| static PLearnCommandRegistry | reg_ |
| This allows to register the 'Stan' command in the command registry. | |
Private Types | |
| typedef PLearnCommand | inherited |
The first sentence should be a BRIEF DESCRIPTION of what the class does.
Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html
typedef PLearnCommand PLearn::Stan::inherited [private] |
| PLearn::Stan::Stan | ( | ) |
Definition at line 50 of file Stan.cc.
: PLearnCommand( "stan", "La commande pour les affaires de Stan", "stan generate path_to_model.psave nb_notes \n" "ex: stan generate /home/stan/Documents/recherche_maitrise/DDBN_bosendorfer/exp_tar_tm1__in_tm1_tp1/exp-expressive_timing-rnet_1hid-sizes=95-7-7-1-1-1-1-1-1-mds=20-stepsize=1-seed=654321-eoss=8-nhid=40-lrl=0.0001-utlm=1-20080529:185450/Split0/LearnerExpdir/final_learner.psave 1 \n" "\n" ) {}
| void PLearn::Stan::run | ( | const std::vector< std::string > & | args | ) | [virtual] |
The actual implementation of the 'Stan' command.
Implements PLearn::PLearnCommand.
Definition at line 61 of file Stan.cc.
References PLearn::endl(), PLearn::DynamicallyLinkedRBMsModel::generate(), PLearn::EmbeddedLearner::getLearner(), PLearn::loadObject(), n, PLearn::perr, PLERROR, and PLearn::toint().
{
string subcommand = args[0];
string modelpath = args[1];
DynamicallyLinkedRBMsModel* model=0;
Object* obj = loadObject(modelpath);
PP<Object> ppobj = obj;
HyperLearner* hyper = dynamic_cast<HyperLearner*>(obj);
if(hyper!=0)
{
PP<PLearner> l = hyper->getLearner();
model = dynamic_cast<DynamicallyLinkedRBMsModel*>((PLearner*)l);
}
else
{
model = dynamic_cast<DynamicallyLinkedRBMsModel*>(obj);
}
if(model==0)
PLERROR("Le fichier doit contenir soit un HyperLearner contenant un DynamicallyLinkedRBMsModel, soit un DynamicallyLinkedRBMsModel directement");
perr << "Successfully loaded " << modelpath << endl;
if(subcommand=="generate")
{
int t = toint(args[2]);
int n = toint(args[3]);
//perr << "Generating " << nb_notes << " notes!" << endl;
perr << "Generating " << endl;
model->generate(t, n);
}
else
perr << "No such subcommand: " << subcommand << endl;
// *** PLEASE COMPLETE HERE ****
}

PLearnCommandRegistry PLearn::Stan::reg_ [static, protected] |
1.7.4