hyperparameter evolution update (#566)

This commit is contained in:
Glenn Jocher 2020-08-02 13:17:26 -07:00
parent fdbcc8fd7f
commit 64e6d199ba
1 changed files with 2 additions and 0 deletions

View File

@ -841,6 +841,8 @@ def print_mutation(hyp, results, yaml_file='hyp_evolved.yaml', bucket=''):
for i, k in enumerate(hyp.keys()): for i, k in enumerate(hyp.keys()):
hyp[k] = float(x[0, i + 7]) hyp[k] = float(x[0, i + 7])
with open(yaml_file, 'w') as f: with open(yaml_file, 'w') as f:
results = x[0, :7]
c = '%10.4g' * len(results) % results # results (P, R, mAP@0.5, mAP@0.5:0.95, val_losses x 3)
f.write('# Hyperparameter Evolution Results\n# Generations: %g\n# Metrics: ' % len(x) + c + '\n\n') f.write('# Hyperparameter Evolution Results\n# Generations: %g\n# Metrics: ' % len(x) + c + '\n\n')
yaml.dump(hyp, f, sort_keys=False) yaml.dump(hyp, f, sort_keys=False)