MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / ColorLoss

Class ColorLoss

script/models/losses.py:5–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import pdb
4
5class 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)
13 if 'rgb_fine' in inputs:
14 loss += self.loss(inputs['rgb_fine'], targets)
15
16 return self.coef * loss
17
18
19class NerfWLoss(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected