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

The first sentence should be a BRIEF DESCRIPTION of what the class does. More...

#include <Stan.h>

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

List of all members.

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

Detailed Description

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

Todo:
Write class to-do's here if there are any.
Deprecated:
Write deprecated stuff here if there is any. Indicate what else should be used instead.

Definition at line 58 of file Stan.h.


Member Typedef Documentation

Definition at line 60 of file Stan.h.


Constructor & Destructor Documentation

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"
        )
{}

Member Function Documentation

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

Here is the call graph for this function:


Member Data Documentation

This allows to register the 'Stan' command in the command registry.

Definition at line 67 of file Stan.h.


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