MosesTuning::Optimizer Class Reference

#include <Optimizer.h>

Inheritance diagram for MosesTuning::Optimizer:

Inheritance graph
[legend]
Collaboration diagram for MosesTuning::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 22 of file Optimizer.h.


Constructor & Destructor Documentation

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

MosesTuning::Optimizer::~Optimizer (  )  [virtual]

Definition at line 64 of file Optimizer.cpp.


Member Function Documentation

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

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

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

statscore_t MosesTuning::Optimizer::GetStatScore ( const Point param  )  const

Definition at line 66 of file Optimizer.cpp.

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

Given a set of nbests, get the Statistical score.

Definition at line 64 of file Optimizer.h.

References m_scorer, and MosesTuning::Scorer::score().

Referenced by MosesTuning::RandomOptimizer::TrueRun().

Here is the call graph for this function:

Here is the caller graph for this function:

statscore_t MosesTuning::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 93 of file Optimizer.cpp.

References MosesTuning::AddThreshold(), MosesTuning::Point::getdim(), k, m, MosesTuning::Point::SetScore(), UTIL_THROW_IF, and MosesTuning::verboselevel().

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

Here is the call graph for this function:

Here is the caller graph for this function:

statscore_t MosesTuning::Optimizer::Run ( Point P  )  const

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

Definition at line 344 of file Optimizer.cpp.

References MosesTuning::Point::GetScore(), MosesTuning::Point::SetScore(), and MosesTuning::verboselevel().

Here is the call graph for this function:

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

Definition at line 37 of file Optimizer.h.

References m_feature_data.

Referenced by main().

Here is the caller graph for this function:

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

Definition at line 34 of file Optimizer.h.

References m_scorer.

Referenced by main().

Here is the caller graph for this function:

unsigned MosesTuning::Optimizer::size (  )  const [inline]

Definition at line 42 of file Optimizer.h.

References m_feature_data.

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

Main function that performs an optimization.

Implemented in MosesTuning::SimpleOptimizer, MosesTuning::RandomDirectionOptimizer, and MosesTuning::RandomOptimizer.


Member Data Documentation

Definition at line 26 of file Optimizer.h.

Referenced by SetFeatureData(), and size().

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

Definition at line 29 of file Optimizer.h.

Definition at line 25 of file Optimizer.h.

Referenced by GetStatScore(), and SetScorer().


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

Generated on Thu Jul 6 00:34:18 2017 for Moses by  doxygen 1.5.9