Download tools/mosesdecoder/moses/FF/HyperParameterAsWeight.cpp from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 634 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/FF/HyperParameterAsWeight.cpp
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/moses/FF/HyperParameterAsWeight.cpp
-
curl -L -o HyperParameterAsWeight.cpp https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/FF/HyperParameterAsWeight.cpp
634 Bytes
| 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; | |
| } | |
| } | |