(self, coef=1)
| 4 | |
| 5 | class ColorLoss(nn.Module): |
| 6 | def __init__(self, coef=1): |
| 7 | super().__init__() |
| 8 | self.coef = coef |
| 9 | self.loss = nn.MSELoss(reduction='mean') |
| 10 | |
| 11 | def forward(self, inputs, targets): |
| 12 | loss = self.loss(inputs['rgb_coarse'], targets) |