tell create-ini about input factors

This commit is contained in:
Hieu Hoang 2013-03-11 19:31:53 +00:00
parent a87316a635
commit 3271710dd5
2 changed files with 12 additions and 1 deletions

View File

@ -18,6 +18,7 @@ using namespace std;
string iniPath;
vector<FF*> ffVec;
bool isHierarchical = false;
int inputFactorMax = 0;
void OutputIni();
void ParseFactors(const string &line, vector< pair<Factors, Factors> > &ret);
@ -76,6 +77,10 @@ int main(int argc, char **argv)
++i;
ParseFactors(argv[i], roFactors);
}
else if (key == "-input-factor-max") {
++i;
inputFactorMax = Scan<int>(argv[i]);
}
else {
cerr << "Unknown arg " << key << endl;
@ -129,7 +134,10 @@ void OutputIni()
weightStrme << "\n\n[weight]" << endl;
strme << "[input-factors]" << endl;
strme << "0" << endl;
for (size_t i = 0; i <= inputFactorMax; ++i) {
strme << i << endl;
}
strme << endl;
strme << "[mapping]" << endl;
if (isHierarchical) {

View File

@ -2087,6 +2087,9 @@ sub define_training_create_config {
my %IN = &get_factor_id("input");
my %OUT = &get_factor_id("output");
$cmd .= "-input-factor-max ".((scalar keys %IN)-1)." ";
$cmd .= "-translation-factors ".
&encode_factor_definition("translation-factors",\%IN,\%OUT)." ";
$cmd .= "-reordering-factors ".