n2j.losses
#
Submodules#
Package Contents#
Classes#
The negative log likelihood (NLL) for a single Gaussian with diagonal |
|
The negative log likelihood (NLL) for a single Gaussian with a full-rank |
|
The negative log likelihood (NLL) for a mixture of two Gaussians, each |
|
- class n2j.losses.DiagonalGaussianNLL(Y_dim, device)[source]#
Bases:
BaseGaussianNLL
The negative log likelihood (NLL) for a single Gaussian with diagonal covariance matrix
BaseGaussianNLL.__init__ docstring for the parameter description.
- posterior_name = 'DiagonalGaussianBNNPosterior'#
- __call__(pred, target)#
Evaluate the NLL. Must be overridden by subclasses.
Parameters#
- predtorch.Tensor
raw network output for the predictions
- targettorch.Tensor
Y labels
- slice(pred)#
Slice the raw network prediction into meaningful Gaussian parameters
Parameters#
- predtorch.Tensor of shape [batch_size, self.Y_dim]
the network prediction
- set_trained_pred(pred)#
- class n2j.losses.FullRankGaussianNLL(Y_dim, device)[source]#
Bases:
BaseGaussianNLL
The negative log likelihood (NLL) for a single Gaussian with a full-rank covariance matrix
See BaseGaussianNLL.__init__ docstring for the parameter description.
- posterior_name = 'FullRankGaussianBNNPosterior'#
- __call__(pred, target)#
Evaluate the NLL. Must be overridden by subclasses.
Parameters#
- predtorch.Tensor
raw network output for the predictions
- targettorch.Tensor
Y labels
- slice(pred)#
Slice the raw network prediction into meaningful Gaussian parameters
Parameters#
- predtorch.Tensor of shape [batch_size, self.Y_dim]
the network prediction
- set_trained_pred(pred)#
- sample(mean, std, n_samples, sample_seed)#
- class n2j.losses.DoubleGaussianNLL(Y_dim, device)[source]#
Bases:
BaseGaussianNLL
The negative log likelihood (NLL) for a mixture of two Gaussians, each with a full but constrained as low-rank plus diagonal covariance
Only rank 2 is currently supported. BaseGaussianNLL.__init__ docstring for the parameter description.
- posterior_name = 'DoubleGaussianBNNPosterior'#
- __call__(pred, target)#
Evaluate the NLL. Must be overridden by subclasses.
Parameters#
- predtorch.Tensor
raw network output for the predictions
- targettorch.Tensor
Y labels
- slice(pred)#
Slice the raw network prediction into meaningful Gaussian parameters
Parameters#
- predtorch.Tensor of shape [batch_size, self.Y_dim]
the network prediction
- set_trained_pred(pred)#