Skip to content

Instantly share code, notes, and snippets.

@adamoudad
Created March 20, 2021 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamoudad/94238542c3dbd31eef1d8392d6e7f9c4 to your computer and use it in GitHub Desktop.
Save adamoudad/94238542c3dbd31eef1d8392d6e7f9c4 to your computer and use it in GitHub Desktop.
epoch_history["loss"].append(sum(batch_history["loss"]) / len(batch_history["loss"]))
epoch_history["accuracy"].append(sum(batch_history["accuracy"]) / len(batch_history["accuracy"]))
model.eval()
print("Validation...")
val_loss, val_accuracy = validate(model, valid_loader)
epoch_history["val_loss"].append(val_loss)
epoch_history["val_accuracy"].append(val_accuracy)
print(f"{epoch_history=}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment