DNNPosterior#

class obsidian.surrogates.custom_torch.DNNPosterior(values: Tensor)[source]#

Bases: EnsemblePosterior

__init__(values: Tensor)[source]#
Parameters:

values – Values of the samples produced by this posterior as a (b) x s x q x m tensor where m is the output size of the model and s is the ensemble size.

Methods

__init__(values)

density(value)

The probability density (or mass) of the distribution.

quantile(value)

Quantile of the ensemble posterior

rsample([sample_shape])

Sample from the posterior (with gradients).

rsample_from_base_samples(sample_shape, ...)

Sample from the posterior (with gradients) using base samples.

sample([sample_shape])

Sample from the posterior without gradients.

Attributes

base_sample_shape

The base shape of the base samples expected in rsample.

batch_range

The t-batch range.

device

The torch device of the posterior.

dtype

The torch dtype of the posterior.

ensemble_size

The size of the ensemble

mean

The mean of the posterior as a (b) x n x m-dim Tensor.

variance

The variance of the posterior as a (b) x n x m-dim Tensor.

weights

The weights of the individual models in the ensemble.

quantile(value: Tensor) Tensor[source]#

Quantile of the ensemble posterior