diff options
author | Patrick Simianer <p@simianer.de> | 2012-03-13 09:24:47 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2012-03-13 09:24:47 +0100 |
commit | ef6085e558e26c8819f1735425761103021b6470 (patch) | |
tree | 5cf70e4c48c64d838e1326b5a505c8c4061bff4a /vest/line_optimizer.h | |
parent | 10a232656a0c882b3b955d2bcfac138ce11e8a2e (diff) | |
parent | dfbc278c1057555fda9312291c8024049e00b7d8 (diff) |
merge with upstream
Diffstat (limited to 'vest/line_optimizer.h')
-rw-r--r-- | vest/line_optimizer.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/vest/line_optimizer.h b/vest/line_optimizer.h deleted file mode 100644 index 99a591f4..00000000 --- a/vest/line_optimizer.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef LINE_OPTIMIZER_H_ -#define LINE_OPTIMIZER_H_ - -#include <vector> - -#include "sparse_vector.h" -#include "error_surface.h" -#include "sampler.h" - -class Weights; - -struct LineOptimizer { - - // use MINIMIZE_SCORE for things like TER, WER - // MAXIMIZE_SCORE for things like BLEU - enum ScoreType { MAXIMIZE_SCORE, MINIMIZE_SCORE }; - - // merge all the error surfaces together into a global - // error surface and find (the middle of) the best segment - static double LineOptimize( - const std::vector<ErrorSurface>& envs, - const LineOptimizer::ScoreType type, - float* best_score, - const double epsilon = 1.0/65536.0); - - // return a random vector of length 1 where all dimensions - // not listed in dimensions will be 0. - static void RandomUnitVector(const std::vector<int>& dimensions, - SparseVector<double>* axis, - RandomNumberGenerator<boost::mt19937>* rng); - - // generate a list of directions to optimize; the list will - // contain the orthogonal vectors corresponding to the dimensions in - // primary and then additional_random_directions directions in those - // dimensions as well. All vectors will be length 1. - static void CreateOptimizationDirections( - const std::vector<int>& primary, - int additional_random_directions, - RandomNumberGenerator<boost::mt19937>* rng, - std::vector<SparseVector<double> >* dirs - , bool include_primary=true - ); - -}; - -#endif |