Skip to content

Likelihood Config

Source

Likelihood model.

Tensor = Annotated[Union[np.ndarray, torch.Tensor], PlainSerializer(_array_to_json, return_type=str), PlainValidator(_to_torch)] module-attribute

Annotated tensor type, used to serialize arrays or tensors to JSON strings and deserialize them back to tensors.

GaussianLikelihoodConfig

Bases: BaseModel

Gaussian likelihood configuration.

logvar_lowerbound = None class-attribute instance-attribute

The lowerbound value for log-variance.

predict_logvar = None class-attribute instance-attribute

If pixelwise, log-variance is computed for each pixel, else log-variance is not computed.

NMLikelihoodConfig

Bases: BaseModel

Noise model likelihood configuration.

NOTE: we need to define the data mean and std here because the noise model is trained on not-normalized data. Hence, we need to unnormalize the model output to compute the noise model likelihood.

data_mean = None class-attribute instance-attribute

The mean of the data, used to unnormalize data for noise model evaluation. Shape is (target_ch,) (or (1, target_ch, [1], 1, 1)).

data_std = None class-attribute instance-attribute

The standard deviation of the data, used to unnormalize data for noise model evaluation. Shape is (target_ch,) (or (1, target_ch, [1], 1, 1)).