Optimizer Class Reference

#include <Optimizer.h>

Inheritance diagram for Optimizer:

Inheritance graph
[legend]
Collaboration diagram for Optimizer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Optimizer (unsigned Pd, const std::vector< unsigned > &i2O, const std::vector< bool > &positive, const std::vector< parameter_t > &start, unsigned int nrandom)
void SetScorer (Scorer *scorer)
void SetFeatureData (FeatureDataHandle feature_data)
virtual ~Optimizer ()
unsigned size () const
statscore_t Run (Point &) const
virtual statscore_t TrueRun (Point &) const =0
void Get1bests (const Point &param, std::vector< unsigned > &bests) const
statscore_t GetStatScore (const std::vector< unsigned > &nbests) const
statscore_t GetStatScore (const Point &param) const
std::vector< statscore_tGetIncStatScore (const std::vector< unsigned > &ref, const std::vector< std::vector< std::pair< unsigned, unsigned > > > &diffs) const
statscore_t LineOptimize (const Point &start, const Point &direction, Point &best) const

Protected Attributes

Scorerm_scorer
FeatureDataHandle m_feature_data
unsigned int m_num_random_directions
const std::vector< bool > & m_positive


Detailed Description

Abstract optimizer class.

Definition at line 18 of file Optimizer.h.


Constructor & Destructor Documentation

Optimizer::Optimizer ( unsigned  Pd,
const std::vector< unsigned > &  i2O,
const std::vector< bool > &  positive,
const std::vector< parameter_t > &  start,
unsigned int  nrandom 
)

Optimizer::~Optimizer (  )  [virtual]

Definition at line 59 of file Optimizer.cpp.


Member Function Documentation

void Optimizer::Get1bests ( const Point param,
std::vector< unsigned > &  bests 
) const

Given a set of lambdas, get the nbest for each sentence.

Referenced by GetStatScore().

Here is the caller graph for this function:

std::vector<statscore_t> Optimizer::GetIncStatScore ( const std::vector< unsigned > &  ref,
const std::vector< std::vector< std::pair< unsigned, unsigned > > > &  diffs 
) const

Referenced by LineOptimize().

Here is the caller graph for this function:

statscore_t Optimizer::GetStatScore ( const Point param  )  const

Definition at line 61 of file Optimizer.cpp.

References Get1bests(), and GetStatScore().

Here is the call graph for this function:

statscore_t Optimizer::GetStatScore ( const std::vector< unsigned > &  nbests  )  const [inline]

Given a set of nbests, get the Statistical score.

Definition at line 56 of file Optimizer.h.

References m_scorer, and Scorer::score().

Referenced by GetStatScore(), Run(), and RandomOptimizer::TrueRun().

Here is the call graph for this function:

Here is the caller graph for this function:

statscore_t Optimizer::LineOptimize ( const Point start,
const Point direction,
Point best 
) const

Get the optimal Lambda and the best score in a particular direction from a given Point.

Definition at line 88 of file Optimizer.cpp.

References AddThreshold(), CHECK, Point::getdim(), GetIncStatScore(), m_feature_data, m_positive, Point::SetScore(), size(), and verboselevel().

Referenced by RandomDirectionOptimizer::TrueRun(), and SimpleOptimizer::TrueRun().

Here is the call graph for this function:

Here is the caller graph for this function:

statscore_t Optimizer::Run ( Point P  )  const

Generic wrapper around TrueRun to check a few things. Non virtual.

Definition at line 330 of file Optimizer.cpp.

References Scorer::getReferenceSize(), Point::GetScore(), GetStatScore(), m_feature_data, m_scorer, Point::SetScore(), TrueRun(), and verboselevel().

Here is the call graph for this function:

void Optimizer::SetFeatureData ( FeatureDataHandle  feature_data  )  [inline]

Definition at line 31 of file Optimizer.h.

References m_feature_data.

Referenced by main().

Here is the caller graph for this function:

void Optimizer::SetScorer ( Scorer scorer  )  [inline]

Definition at line 30 of file Optimizer.h.

References m_scorer.

Referenced by main().

Here is the caller graph for this function:

unsigned Optimizer::size (  )  const [inline]

Definition at line 34 of file Optimizer.h.

References m_feature_data.

Referenced by LineOptimize().

Here is the caller graph for this function:

virtual statscore_t Optimizer::TrueRun ( Point  )  const [pure virtual]

Main function that performs an optimization.

Implemented in SimpleOptimizer, RandomDirectionOptimizer, and RandomOptimizer.

Referenced by Run().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 22 of file Optimizer.h.

Referenced by LineOptimize(), Run(), SetFeatureData(), and size().

unsigned int Optimizer::m_num_random_directions [protected]

Definition at line 23 of file Optimizer.h.

Referenced by RandomDirectionOptimizer::TrueRun(), and SimpleOptimizer::TrueRun().

const std::vector<bool>& Optimizer::m_positive [protected]

Definition at line 25 of file Optimizer.h.

Referenced by LineOptimize().

Definition at line 21 of file Optimizer.h.

Referenced by GetStatScore(), Run(), and SetScorer().


The documentation for this class was generated from the following files:

Generated on Sat Jun 30 00:30:12 2012 for Moses by  doxygen 1.5.9