learn.probabilistic.init_log_posterior_fn#
- init_log_posterior_fn(likelihood, prior, train_loader, batch_size, batch_cache)[source]#
Initializes the log-posterior function.
Initializes a function that computes the log-posterior value of a parameter sample. The full log-posterior is computed batch-wise to avoid out-of-memory errors during the forward and backward pass.
- Parameters:
likelihood – Likelihood function
prior – Prior function
train_loader – Train data loader
batch_size – Batch-size for batch-wise computation of the sub-likelihoods
batch_cache – Number of batches to store in cache
- Returns:
Log-posterior function