From 14cbd8c0cab8957b7898f036c636448448a5cd0b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 21 Jul 2019 19:18:15 +0200 Subject: [PATCH] updates --- train.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/train.py b/train.py index 34a08bff..212e379f 100644 --- a/train.py +++ b/train.py @@ -328,7 +328,7 @@ def print_mutation(hyp, results): with open('evolve.txt', 'a') as f: # append result f.write(c + b + '\n') x = np.unique(np.loadtxt('evolve.txt', ndmin=2), axis=0) # load unique rows - np.savetxt('evolve.txt', x[np.argsort(-fitness(x))] , '%11.3g') # save sort by fitness + np.savetxt('evolve3.txt', x[np.argsort(-fitness(x))], '%11.3g') # save sort by fitness os.system('gsutil cp evolve.txt gs://%s' % opt.bucket) # upload evolve.txt else: with open('evolve.txt', 'a') as f: @@ -410,14 +410,14 @@ if __name__ == '__main__': # # Plot results # import numpy as np # import matplotlib.pyplot as plt - # a = np.loadtxt('evolve_1000val.txt') - # x = a[:, 2] * a[:, 3] # metric = mAP * F1 + # a = np.loadtxt('evolve.txt') + # x = fitness(a) # weights = (x - x.min()) ** 2 - # fig = plt.figure(figsize=(14, 7)) + # fig = plt.figure(figsize=(10, 10)) # for i in range(len(hyp)): # y = a[:, i + 5] # mu = (y * weights).sum() / weights.sum() - # plt.subplot(2, 5, i+1) + # plt.subplot(4, 5, i + 1) # plt.plot(x.max(), mu, 'o') # plt.plot(x, y, '.') - # print(list(hyp.keys())[i],'%.4g' % mu) + # print(list(hyp.keys())[i], '%.4g' % mu)