MCPcopy Create free account
hub / github.com/andreariba/DeepCycle / plot_training

Function plot_training

DeepCycle.py:427–437  ·  view source on GitHub ↗
(fit)

Source from the content-addressed store, hash-verified

425
426#FUNCTION TO PLOT THE TRAINING
427def plot_training(fit):
428 best_epoch = fit.epoch[fit.history['val_loss'].index(min(fit.history['val_loss']))]
429 fig, ax = plt.subplots(figsize=(3,3))
430 ax.plot(fit.epoch,fit.history['val_loss'],'.-',color='red', label='validation')
431 ax.plot(fit.epoch,fit.history['loss'],'.-',color='orange', label='train')
432 ax.set_yscale('log')
433 ax.set(ylabel='MSE')
434 ax.axvspan(best_epoch-0.5,best_epoch+0.5, alpha=0.5, color='red')
435 ax.legend()
436 print("[Best epoch]:", best_epoch)
437 print("[MSE]:", min(fit.history['val_loss']))
438
439
440

Callers 1

DeepCycle.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected