Welcome to mirror list, hosted at ThFree Co, Russian Federation.

HyperParameterAsWeight.cpp « FF « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 37516af52b72aafc1d16da56c19887b72f26c4fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "HyperParameterAsWeight.h"
#include "moses/StaticData.h"

using namespace std;

namespace Moses
{

HyperParameterAsWeight::HyperParameterAsWeight(const std::string &line)
  :StatelessFeatureFunction(2, line)
{
  ReadParameters();

  // hack into StaticData and change anything you want
  // as an example, we have 2 weights and change
  //   1. stack size
  //   2. beam width
  StaticData &staticData = StaticData::InstanceNonConst();

  vector<float> weights = staticData.GetWeights(this);

  staticData.m_options.search.stack_size = weights[0] * 1000;
  staticData.m_options.search.beam_width = weights[1] * 10;

}


}