Ejemplo n.º 1
0
                                                       meanLoss / (i + 1)))

# Logging reults
experiment.log_metric("test_loss", meanLoss / (i + 1), step=epoch)
experiment.log_metric("test_accuracy", acc, step=epoch)

# # plotting graphs (not needed if using comet ml)
# plt.figure()
# x = np.linspace(0,hyper_params["num_epochs"],hyper_params["num_epochs"])
# plt.subplot(1,2,1)
# plt.plot(x,trainLoss)
# plt.plot(x,validLoss)
#
# plt.subplot(1,2,2)
# plt.plot(x,validAcc)
# plt.savefig(path+'/learning_curve.png')
# plt.show()

# Plotting confusion matrix
plt.figure()
cm = confusion_matrix(ground_truth, predictions)
plot_confusion_matrix(cm.astype(np.int64),
                      classes=["None", "w", "q", "e", "w+q", "w+e"],
                      path=".")

experiment.log_image("./confusion_matrix.png")

dict = {"test_acc": test_acc}

experiment.send_notification("finished", "ok tamere", dict)