diff --git a/train.py b/train.py index 7ff15b7d..8c386687 100644 --- a/train.py +++ b/train.py @@ -305,6 +305,11 @@ if __name__ == '__main__': x = (np.random.randn(1) * 0.3 + 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'] = np.clip(hyp['momentum'], 0, 0.98) + hyp['weight_decay'] = np.clip(hyp['weight_decay'], 0, 0.01) + # Normalize loss components (sum to 1) lcf = ['xy', 'wh', 'cls', 'conf'] s = sum([v for k, v in hyp.items() if k in lcf])