MosesTuning::MiraWeightVector Class Reference

#include <MiraWeightVector.h>

List of all members.

Public Member Functions

 MiraWeightVector ()
 MiraWeightVector (const std::vector< ValType > &init)
void update (const MiraFeatureVector &fv, float tau)
void tick ()
ValType score (const MiraFeatureVector &fv) const
ValType sqrNorm () const
AvgWeightVector avg ()
void ToSparse (SparseVector *sparse, size_t denseSize) const

Friends

class AvgWeightVector
std::ostream & operator<< (std::ostream &o, const MiraWeightVector &e)


Detailed Description

Definition at line 24 of file MiraWeightVector.h.


Constructor & Destructor Documentation

MosesTuning::MiraWeightVector::MiraWeightVector (  ) 

Constructor, initializes to the zero vector

Definition at line 14 of file MiraWeightVector.cpp.

MosesTuning::MiraWeightVector::MiraWeightVector ( const std::vector< ValType > &  init  ) 

Constructor with provided initial vector

Parameters:
init Initial feature values


Member Function Documentation

AvgWeightVector MosesTuning::MiraWeightVector::avg (  ) 

Return an averaged view of this weight vector

Definition at line 71 of file MiraWeightVector.cpp.

References AvgWeightVector.

ValType MosesTuning::MiraWeightVector::score ( const MiraFeatureVector fv  )  const

Score a feature vector according to the model

Parameters:
fv Feature vector to be scored

Definition at line 59 of file MiraWeightVector.cpp.

References MosesTuning::MiraFeatureVector::feat(), MosesTuning::MiraFeatureVector::size(), and MosesTuning::MiraFeatureVector::val().

Referenced by MosesTuning::NbestHopeFearDecoder::HopeFear().

Here is the call graph for this function:

Here is the caller graph for this function:

ValType MosesTuning::MiraWeightVector::sqrNorm (  )  const

Squared norm of the weight vector

Definition at line 131 of file MiraWeightVector.cpp.

void MosesTuning::MiraWeightVector::tick (  ) 

Perform an empty update (affects averaging)

Definition at line 50 of file MiraWeightVector.cpp.

void MosesTuning::MiraWeightVector::ToSparse ( SparseVector sparse,
size_t  denseSize 
) const

Convert to sparse vector, interpreting all features as sparse. Only used by hgmira.

Definition at line 96 of file MiraWeightVector.cpp.

References MosesTuning::SparseVector::set().

Here is the call graph for this function:

void MosesTuning::MiraWeightVector::update ( const MiraFeatureVector fv,
float  tau 
)

Update a the model

Parameters:
fv Feature vector to be added to the weights
tau FV will be scaled by this value before update

Definition at line 39 of file MiraWeightVector.cpp.

References MosesTuning::MiraFeatureVector::feat(), MosesTuning::MiraFeatureVector::size(), update(), and MosesTuning::MiraFeatureVector::val().

Referenced by update().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class AvgWeightVector [friend]

Definition at line 71 of file MiraWeightVector.h.

Referenced by avg().

std::ostream& operator<< ( std::ostream &  o,
const MiraWeightVector e 
) [friend]


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