(self, sample, dims=[1, 2, 3])
| 435 | ) |
| 436 | |
| 437 | def nll(self, sample, dims=[1, 2, 3]): |
| 438 | if self.deterministic: |
| 439 | return torch.Tensor([0.0]) |
| 440 | logtwopi = np.log(2.0 * np.pi) |
| 441 | return 0.5 * torch.sum( |
| 442 | logtwopi + self.logvar + torch.pow(sample - self.mean, 2) / self.var, |
| 443 | dim=dims, |
| 444 | ) |
| 445 | |
| 446 | def mode(self): |
| 447 | return self.mean |
nothing calls this directly
no outgoing calls
no test coverage detected