mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 07:48:50 +08:00
Loss Metric Refactoring (#181)
* metrics also returned on forward pass, reduction moved to right before backprop
This commit is contained in:
1 parent
a78394c49d
commit
960ac94e06
3 files changed
+27
-19
No files matched your search
@@ -140,10 +140,13 @@ class NeRFGraph(Graph):
|
||||
}
|
||||
return outputs
|
||||
|
||||
def get_loss_dict(self, outputs, batch):
|
||||
image = batch["image"]
|
||||
def get_loss_dict(self, outputs, batch) -> Dict[str, torch.tensor]:
|
||||
device = outputs["rgb_coarse"].device
|
||||
image = batch["image"].to(device)
|
||||
|
||||
rgb_loss_coarse = self.rgb_loss(image, outputs["rgb_coarse"])
|
||||
rgb_loss_fine = self.rgb_loss(image, outputs["rgb_fine"])
|
||||
|
||||
loss_dict = {"rgb_loss_coarse": rgb_loss_coarse, "rgb_loss_fine": rgb_loss_fine}
|
||||
return loss_dict
|
||||
|
||||
|
||||
Reference in new issue
Block a user