Skip to content

Instantly share code, notes, and snippets.

@aryan-jadon
Created September 15, 2022 06:54
Show Gist options
  • Save aryan-jadon/6cf22bd5df9672406d6c3f9364d847d1 to your computer and use it in GitHub Desktop.
Save aryan-jadon/6cf22bd5df9672406d6c3f9364d847d1 to your computer and use it in GitHub Desktop.
metrics.py
from sklearn import metrics
# Measure RMSE error. RMSE is common for regression.
pred = model(x_test)
score = torch.sqrt(torch.nn.functional.mse_loss(pred.flatten(),y_test))
print(f"Final score (RMSE): {score}")
## Final score (RMSE): 3.3968639373779297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment