diff options
author | jfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-16 14:57:24 +0400 |
---|---|---|
committer | jfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-16 14:57:24 +0400 |
commit | e9df80a05c442b8b22aad79206872b90ab8c97c1 (patch) | |
tree | 74ddf98cf565dad31ef72c7f2219ae795c4d08d6 /mert/Optimizer.h | |
parent | bb42cb0dd591fa91d3ae63a2380a1ba6caed83a2 (diff) |
bugfixes
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1726 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/Optimizer.h')
-rw-r--r-- | mert/Optimizer.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/mert/Optimizer.h b/mert/Optimizer.h index d5c066bb6..23df73e67 100644 --- a/mert/Optimizer.h +++ b/mert/Optimizer.h @@ -20,7 +20,7 @@ class Optimizer{ Scorer * scorer; //no accessor for them only child can use them FeatureData * FData;//no accessor for them only child can use them public: - Optimizer(unsigned Pd,vector<unsigned> i2O,parameters_t start); + Optimizer(unsigned Pd,vector<unsigned> i2O,vector<parameter_t> start); void SetScorer(Scorer *S); void SetFData(FeatureData *F); virtual ~Optimizer(); @@ -46,11 +46,32 @@ class SimpleOptimizer: public Optimizer{ private: static float eps; public: - SimpleOptimizer(unsigned dim,vector<unsigned> i2O,parameters_t start):Optimizer(dim,i2O,start){}; + SimpleOptimizer(unsigned dim,vector<unsigned> i2O,vector<parameter_t> start):Optimizer(dim,i2O,start){}; virtual statscore_t TrueRun(Point&)const; }; -Optimizer *BuildOptimizer(unsigned dim,vector<unsigned>tooptimize,parameters_t start,string type); +class RandomOptimizer: public Optimizer{ +public: + RandomOptimizer(unsigned dim,vector<unsigned> i2O,vector<parameter_t> start):Optimizer(dim,i2O,start){}; + virtual statscore_t TrueRun(Point&)const; +}; + + + +class OptimizerFactory{ + public: + // unsigned dim; + //Point Start; + static vector<string> GetTypeNames(); + static Optimizer* BuildOptimizer(unsigned dim,vector<unsigned>tooptimize,vector<parameter_t> start,string type); + private: + enum OptType{POWELL=0,RANDOM,NOPTIMIZER};//Add new optimizer here BEFORE NOPTIMZER + static OptType GetOType(string); + static vector<string> typenames; + static void SetTypeNames(); + +}; + #endif |