MCPcopy
hub / github.com/WongKinYiu/PyTorch_YOLOv4 / plot_evolution_results

Function plot_evolution_results

utils/utils.py:931–948  ·  view source on GitHub ↗
(hyp)

Source from the content-addressed store, hash-verified

929
930
931def plot_evolution_results(hyp): # from utils.utils import *; plot_evolution_results(hyp)
932 # Plot hyperparameter evolution results in evolve.txt
933 x = np.loadtxt('evolve.txt', ndmin=2)
934 f = fitness(x)
935 weights = (f - f.min()) ** 2 # for weighted results
936 fig = plt.figure(figsize=(12, 10))
937 matplotlib.rc('font', **{'size': 8})
938 for i, (k, v) in enumerate(hyp.items()):
939 y = x[:, i + 7]
940 # mu = (y * weights).sum() / weights.sum() # best weighted result
941 mu = y[f.argmax()] # best single result
942 plt.subplot(4, 5, i + 1)
943 plt.plot(mu, f.max(), 'o', markersize=10)
944 plt.plot(y, f, '.')
945 plt.title('%s = %.3g' % (k, mu), fontdict={'size': 9}) # limit to 40 characters
946 print('%15s: %.3g' % (k, mu))
947 fig.tight_layout()
948 plt.savefig('evolve.png', dpi=200)
949
950
951def plot_results_overlay(start=0, stop=0): # from utils.utils import *; plot_results_overlay()

Callers

nothing calls this directly

Calls 1

fitnessFunction · 0.70

Tested by

no test coverage detected