Last active
December 29, 2020 03:14
-
-
Save 1pha/b7da9e4c710083f9b8799a2afcebd936 to your computer and use it in GitHub Desktop.
RMSE loss for pytorch (from pytorch discussion)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RMSELoss(nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.mse = nn.MSELoss() | |
def forward(self, yhat, y): | |
return torch.sqrt(self.mse(yhat, y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment