change create-ini to give implementation independent names to LM

This commit is contained in:
Hieu Hoang 2013-03-18 15:53:42 +00:00
parent 2c26ad133e
commit 96b43c2ded
2 changed files with 21 additions and 9 deletions

View File

@ -2,3 +2,22 @@
int LM::s_index = 0;
void LM::Output(std::ostream &out) const
{
out << name
<< " name=LM" << index
<< " order=" << order
<< " factor=" << OutputFactors(outFactors)
<< " path=" << path
<< " " << otherArgs
<< std::endl;
}
void LM::OutputWeights(std::ostream &out) const
{
out << "LM" << index << "= ";
for (size_t i = 0; i < numFeatures; ++i) {
out << GetWeight() << " ";
}
out << std::endl;
}

View File

@ -13,15 +13,8 @@ class LM : public FF
float GetWeight() const
{ return 0.5; }
void Output(std::ostream &out) const
{
out << name
<< " order=" << order
<< " factor=" << OutputFactors(outFactors)
<< " path=" << path
<< " " << otherArgs
<< std::endl;
}
void Output(std::ostream &out) const;
void OutputWeights(std::ostream &out) const;
public:
std::string otherArgs;