diff options
author | Peng Wu <alexepico@gmail.com> | 2011-07-15 17:13:00 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-07-15 17:13:16 +0800 |
commit | d80de14cdd22cedf6821d123165beda4d80ff91e (patch) | |
tree | ff90043e9d8aefe8eaa2ea88ec77eec0ea96bf61 | |
parent | fe2d8789c1b1ba6fab743ea7ff9d16c4306e46e3 (diff) | |
download | trainer-d80de14cdd22cedf6821d123165beda4d80ff91e.tar.gz trainer-d80de14cdd22cedf6821d123165beda4d80ff91e.tar.xz trainer-d80de14cdd22cedf6821d123165beda4d80ff91e.zip |
re-design epochs
-rw-r--r-- | docs/fileformat | 2 | ||||
-rw-r--r-- | lib/myconfig.py | 16 | ||||
-rw-r--r-- | lib/utils.py | 6 |
3 files changed, 9 insertions, 15 deletions
diff --git a/docs/fileformat b/docs/fileformat index 8ef722a..bd94abe 100644 --- a/docs/fileformat +++ b/docs/fileformat @@ -37,7 +37,7 @@ Status File Format 1. The model files are placed in the same sub-directory as <items>.index; 2. Each model files are named as 'model-candidates-0.db', etc. 3. The status files are named as 'model-candidates-0.db.status', like: - {'GenerateEpoch': 2} + {'GenerateEpoch': 2, 'GenerateStart': 100, 'GenerateEnd': 200}. Estimate Status Files 1. For model-candidates-<num>.db, model-candidates-<num>.db.status are generated, like: {'EstimateEpoch': 3, 'EstimateScore': 0.7} diff --git a/lib/myconfig.py b/lib/myconfig.py index 5e95582..7f46676 100644 --- a/lib/myconfig.py +++ b/lib/myconfig.py @@ -11,20 +11,8 @@ class MyConfig: 'EvaluateEpoch': 5 \ } - def getSegmentEpoch(self): - return self.m_current_epoch['SegmentEpoch'] - - def getGenerateEpoch(self): - return self.m_current_epoch['GenerateEpoch'] - - def getEstimateEpoch(self): - return self.m_current_epoch['EstimateEpoch'] - - def getPruneEpoch(self): - return self.m_current_epoch['PruneEpoch'] - - def getEvaluateEpoch(self): - return self.m_current_epoch['EvaluateEpoch'] + def getEpochs(self): + return self.m_current_epoch m_trainer_dir = '/media/data/Program/trainer' diff --git a/lib/utils.py b/lib/utils.py index 156fbaf..9024c7e 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -28,6 +28,12 @@ def store_status(outfile, obj): write_file(outfile, json.dumps(obj)) return +def check_epoch(obj, passname): + pass + +def sign_epoch(obj, passname): + pass + #test case if __name__ == '__main__': obj = load_status('/tmp/test.status') |