Skip to content

Commit

Permalink
improve tryprune
Browse files Browse the repository at this point in the history
  • Loading branch information
epico committed Jul 26, 2011
1 parent 1966705 commit 9c3a0ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/fileformat
Expand Up @@ -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}
4 changes: 4 additions & 0 deletions tryprune.py
Expand Up @@ -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)
Expand Down

0 comments on commit 9c3a0ed

Please sign in to comment.