Tanl Linguistic Pipeline

Tanl::Classifier::LBFGS Class Reference
[Classifier]

Inheritance diagram for Tanl::Classifier::LBFGS:
Tanl::Classifier::MaxEnt Tanl::Classifier::Classifier

List of all members.

Public Member Functions

 LBFGS (EventStream &es, int iterations, int cutoff=0, double eps=1E-05)
 Create and train a model from events from a single EventStream.
 LBFGS (int iterations=50, int cutoff=0, double eps=1E-05)
 The EventStream is supplied separately with method read().
void train ()
 Train a model on events read with previous calls to read().
void train (EventStream &es)
 Train a model on events read from.
void save (char const *path)
 Save the model to file.
void writeHeader (std::ofstream &ofs)
void writeData (std::ofstream &ofs)

Protected Attributes

double * lambda
 the model parameters

Constructor & Destructor Documentation

Tanl::Classifier::LBFGS::LBFGS ( EventStream es,
int  iterations,
int  cutoff = 0,
double  eps = 1E-05 
)

Create and train a model from events from a single EventStream.

Parameters:
es the EventStream from which to read training events
iterations max number of iterations to perform
cutoff discard predicates that do not occur at least this many times in the training set
eps determines the terminating accuracy

References train().

Tanl::Classifier::LBFGS::LBFGS ( int  iterations = 50,
int  cutoff = 0,
double  eps = 1E-05 
)

The EventStream is supplied separately with method read().

This is useful to supply several streams in turn (for instance data from several files).

Parameters:
iterations max number of iterations to perform
cutoff discard predicates that do not occur at least this many times in the training set
eps determines the terminating accuracy

Member Function Documentation

void Tanl::Classifier::LBFGS::save ( char const *  file  ) 

Save the model to file.

Format for the GIS maxent (.mem) files.

This format can be memory mapped.

1. GIS (model type identifier)

2. the correction constant (int)

3. the correction parameter (double)

4. # of outcomes (int)

  • list of outcome names (string)

5. # of predicates (int)

  • list of predicate names (string)

6. parameters

  • # of groups (i.e. predicates with same set of outcomes)
  • The following repeated for each group a. group size (gs), # group outcomes
    • The following repeated for each outcome: 1. outcome (i) 2. param[n + j, i], for 0 <= j < gs

Example of 5. and 6.: 7(# preds) Sunny(first pred. name) Happy Dry Humid Sad Cloudy Rainy 3(# groups) 1 1(group 1: 1 predicate, 1 outcome) 0(outcome 0) 2.4005893(param[0, 0]) 5 2(group 2: 5 predicates, 2 outcomes) 0(outcome 0) 2.1392054(param[1, 0]) -0.3270814(param[2, 0]) 0.2927261(param[3, 0]) -1.9319866(param[4, 0]) 1.1981091(param[5, 0]) 1(outcome 1) -4.7484765(param[1, 1]) 0.3342510(param[2, 1]) -0.3882752(param[3, 1]) 2.0065205(param[4, 1]) -2.1725304(param[5, 1]) 1 1(group 3: 1 predicate, 1 outcome) 1(outcome 1) 3.5907883(param[6, 1])

Reimplemented from Tanl::Classifier::MaxEnt.

void Tanl::Classifier::LBFGS::train ( EventStream es  ) 

Train a model on events read from.

Parameters:
es. 

References Tanl::Classifier::MaxEnt::read(), and train().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
 
Copyright © 2005-2011 G. Attardi. Generated on 4 Mar 2011 by doxygen 1.6.1.