WeightSamples
WeightSamples(n_samples=100)Sample weights from the posterior and average the predictive over the samples.
For a weight-space posterior \(\mathcal{N}(\mu, \Sigma)\) it draws weights \(\theta_s \sim \mathcal{N}(\mu, \Sigma)\), \(s = 1, \dots, S\), runs the model at each, and averages the outputs \(f(x; \theta_s)\) into a predictive as MC does. It needs forward passes only.
Needs a weight-space posterior (WeightPosterior): a function-space posterior has no weights to sample.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n_samples | int | The number of weight draws \(S\). | 100 |
Attributes
| Name | Description |
|---|---|
| requires | Nothing beyond forward passes. |