diff --git a/train.py b/train.py index d6364fc0..25f88de6 100644 --- a/train.py +++ b/train.py @@ -301,14 +301,15 @@ if __name__ == '__main__': # Mutate hyperparameters old_hyp = hyp.copy() init_seeds(seed=int(time.time())) - for k in hyp.keys(): - x = (np.random.randn(1) * 0.2 + 1) ** 1.1 # plt.hist(x.ravel(), 100) + s = [.3, .3, .3, .3, .3, .3, .3, .3, .05, .3] + for i, k in enumerate(hyp.keys()): + x = (np.random.randn(1) * s[i] + 1) ** 1.1 # plt.hist(x.ravel(), 100) hyp[k] = hyp[k] * float(x) # vary by about 30% 1sigma # Apply limits hyp['iou_t'] = np.clip(hyp['iou_t'], 0, 0.90) - hyp['momentum'] = 0.9 # np.clip(hyp['momentum'], 0, 0.98) - hyp['weight_decay'] = 0.0005 # np.clip(hyp['weight_decay'], 0, 0.01) + hyp['momentum'] = np.clip(hyp['momentum'], 0.7, 0.98) + hyp['weight_decay'] = np.clip(hyp['weight_decay'], 0, 0.01) # Normalize loss components (sum to 1) lcf = ['xy', 'wh', 'cls', 'conf'] @@ -345,3 +346,13 @@ if __name__ == '__main__': best_fitness = mutation_fitness else: hyp = old_hyp.copy() # reset hyp to + + +import numpy as np +import matplotlib.pyplot as plt +a = np.loadtxt('evolve.txt') +x = a[:,3] +fig = plt.figure(figsize=(14, 7)) +for i in range(1,10): + plt.subplot(2,5,i) + plt.plot(x,a[:,i+5],'.')