feat(Model): now successfully training the basic LSTM model

This commit is contained in:
Mark Aron Szulyovszky
2021-11-11 18:29:05 +01:00
parent 78b3c07420
commit 5f8efc97fa
3 changed files with 36 additions and 30 deletions
+15
View File
@@ -0,0 +1,15 @@
import matplotlib.pyplot as plt
def visualize_loss(history, title: str):
loss = history.history["loss"]
val_loss = history.history["val_loss"]
epochs = range(len(loss))
plt.figure()
plt.plot(epochs, loss, "b", label="Training loss")
plt.plot(epochs, val_loss, "r", label="Validation loss")
plt.title(title)
plt.xlabel("Epochs")
plt.ylabel("Loss")
plt.legend()
plt.show()