Permalink
Browse files

improve tryprune

  • Loading branch information...
1 parent 1966705 commit 9c3a0edbe6c9b0e2d792e8edfba849175daefe0f @epico epico committed Jul 26, 2011
Showing with 8 additions and 2 deletions.
  1. +4 −2 docs/fileformat
  2. +4 −0 tryprune.py
View
@@ -48,7 +48,9 @@ Status File Format
1. 'merged.db', 'kmm_merged.text' , 'pruned.db', 'kmm_pruned.text', 'interpolation.text' are generated when running prune tools in 'finals/try<name>' sub-directory.
2. 'cwd.status' file are generated also, like:
{'PruneEpoch': 4, 'PruneMergeNumber': 1000,
- 'PruneK':2, 'PruneCDF': 0.6}
+ 'PruneModelSize' : 10000000,
+ 'PruneK' : 2, 'PruneCDF' : 0.6}
Evaluate Status Files
1. 'cwd.status' file are generated, like:
- {'EvaluateEpoch': 5, 'EvaluateAverageLambda': 0.66, 'EvaluateCorrectionRate': 0.77}
+ {'EvaluateEpoch': 5, 'EvaluateAverageLambda': 0.66,
+ 'EvaluateCorrectionRate': 0.77}
View
@@ -198,6 +198,10 @@ def pruneModel(prunedmodel, k, CDF):
inter_model = os.path.join(trydir, config.getFinalModelFileName())
convertModel(kmm_model, inter_model)
+ modelsize = utils.get_file_length(inter_model)
+ cwdstatus['PruneModelSize'] = modelsize
+ print('final model size:' + modelsize)
+
#sign status epoch
utils.sign_epoch(cwdstatus, 'Prune')
utils.store_status(cwdstatuspath, cwdstatus)

0 comments on commit 9c3a0ed

Please sign in to comment.