How to plot train and validation accuracy graph? - PyTorch Forums
discuss.pytorch.org › t › how-to-plot-train-andDec 08, 2020 · One simple way to plot your losses after the training would be using matplotlib: import matplotlib.pyplot as pltval_losses = []train_losses = []training looptrain_losses.append(loss_train.item())testingval_losses.append(loss_val.item())plt.figure(figsize=(10,5))plt.title("Training and Validation Loss")plt.plot(val_losses,label="val")plt.plot(train_losses,label="train")plt.xlabel("iterations")plt.ylabel("Loss")plt.legend()plt.show()