| PLearn 0.1 | 
#include <VarMeasurer.h>


| Public Member Functions | |
| VarMeasurer (Var the_v, int the_every, const string &the_filename, const string &the_onscreen_prompt="") | |
| virtual bool | measure (int t, const Vec &costs) | 
| Public Attributes | |
| Var | v | 
| int | every | 
| string | filename | 
| ofstream | out | 
| string | onscreen_prompt | 
Definition at line 53 of file VarMeasurer.h.
| PLearn::VarMeasurer::VarMeasurer | ( | Var | the_v, | 
| int | the_every, | ||
| const string & | the_filename, | ||
| const string & | the_onscreen_prompt = "" | ||
| ) |  [inline] | 
Definition at line 64 of file VarMeasurer.h.
This method is called at iteration t of a training algorithm, and it can monitor the cost values given the costs vector. The returned value indicates whether training should be stopped (by default shoudl be false).
Reimplemented from PLearn::Measurer.
Definition at line 45 of file VarMeasurer.cc.
References PLearn::endl(), and i.
{
    if (t%every == 0)
    {
        if (out)
        {
            out << t << ' ';
            for (int i=0; i<v->length(); i++)
                out << v->value[i] << ' ';
            out << endl;
        }
        if (onscreen_prompt.size() != 0)
        {
            cout << t << ": " << onscreen_prompt << " ";
            for (int i=0; i<v->length(); i++)
                cout << v->value[i] << ' ';
            cout << endl;
        }
    }
    return false;
}

Definition at line 57 of file VarMeasurer.h.
Definition at line 58 of file VarMeasurer.h.
Definition at line 60 of file VarMeasurer.h.
| ofstream PLearn::VarMeasurer::out | 
Definition at line 59 of file VarMeasurer.h.
Definition at line 56 of file VarMeasurer.h.
 1.7.4
 1.7.4