(self, sample, dims=[1,2,3])
| 72 | dim=[1, 2, 3]) |
| 73 | |
| 74 | def nll(self, sample, dims=[1,2,3]): |
| 75 | if self.deterministic: |
| 76 | return torch.Tensor([0.]) |
| 77 | logtwopi = np.log(2.0 * np.pi) |
| 78 | return 0.5 * torch.sum( |
| 79 | logtwopi + self.logvar + torch.pow(sample - self.mean, 2) / self.var, |
| 80 | dim=dims) |
| 81 | |
| 82 | def mode(self): |
| 83 | return self.mean |
nothing calls this directly
no outgoing calls
no test coverage detected