diff options
author | jfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-14 20:19:00 +0400 |
---|---|---|
committer | jfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-14 20:19:00 +0400 |
commit | cff8d4702bee2e1ae43806c9d46cd6c1cce022cc (patch) | |
tree | d7d73ddc0faea0865fa1bd8cb9abe9470337adaa /mert/Optimizer.h | |
parent | 13f6a427c514e96a50df0587c45fd4feeaba08ba (diff) |
add some sanity checks
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1668 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/Optimizer.h')
-rw-r--r-- | mert/Optimizer.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mert/Optimizer.h b/mert/Optimizer.h index 4a18fdae6..ee43eaf32 100644 --- a/mert/Optimizer.h +++ b/mert/Optimizer.h @@ -21,7 +21,7 @@ class Optimizer{ Scorer * scorer; FeatureData * FData; /**number of lambda parameters*/ - unsigned dimension; + const unsigned dimension; Optimizer(unsigned d):dimension(d),scorer(NULL),FData(NULL){}; void SetScorer(Scorer *S); void SetFData(FeatureData *F); @@ -29,10 +29,11 @@ class Optimizer{ delete scorer; delete FData; } - /**Number of sentences in the tuning set*/ - unsigned N; - /**main function that perform an optimization*/ - virtual Point run(const Point& init); + unsigned size(){return (FData?FData->size():0);} + /**Generic wrapper around TrueRun to check a few things. Non virtual*/ + Point Run(const Point& init); +/**main function that perform an optimization*/ + virtual Point TrueRun(const Point& init); /**given a set of lambdas, get the nbest for each sentence*/ vector<unsigned> Get1bests(const Point& param); /**given a set of nbests, get the Statistical score*/ @@ -48,7 +49,7 @@ class SimpleOptimizer: public Optimizer{ private: float eps; public: SimpleOptimizer(unsigned dim,float _eps):Optimizer(dim),eps(_eps){}; - Point run(const Point& init); + virtual Point TrueRun(const Point& init); }; #endif |