-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloss_functions.py
More file actions
38 lines (26 loc) · 842 Bytes
/
Copy pathloss_functions.py
File metadata and controls
38 lines (26 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import torch
from torchmetrics import MeanSquaredLogError
class RMSELoss(torch.nn.Module):
def __init__(self):
super().__init__()
self.mse = torch.nn.MSELoss()
def forward(self, yhat, y):
return torch.sqrt(self.mse(yhat, y))
class MSE(torch.nn.Module):
def __init__(self):
super().__init__()
self.loss = torch.nn.MSELoss()
def forward(self, yhat, y):
return self.loss(yhat, y)
class MSLE(torch.nn.Module):
def __init__(self):
super().__init__()
self.loss = MeanSquaredLogError()
def forward(self, yhat, y):
return self.loss(yhat, y)
class RMSLE(torch.nn.Module):
def __init__(self):
super().__init__()
self.msle = MeanSquaredLogError()
def forward(self, yhat, y):
return torch.sqrt(self.msle(yhat, y))