Trainer
Trainer()Trains a network on the data and returns its Laplace posterior.
LaplaceBoTorchSurrogate calls its trainer with the network and the training data, after the input and outcome transforms. The posterior must have an lk.Gaussian likelihood with a one-element sigma, the noise scale of the outcomes.
Methods
| Name | Description |
|---|---|
| call | Train net on the data and fit the Laplace approximation. |
call
Trainer.__call__(net, train_X, train_Y, *, train_Yvar)Train net on the data and fit the Laplace approximation.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| net | nn.Module | The network given to LaplaceBoTorchSurrogate. |
required |
| train_X | Any | The inputs, [n, d], or what the network’s prepare made of them. |
required |
| train_Y | Tensor | The outcomes, [n, m]. |
required |
| train_Yvar | float | None | The noise variance to keep fixed, or None for the trainer’s own choice. |
required |
Returns
| Name | Type | Description |
|---|---|---|
| WeightPosterior | The posterior. Its likelihood is an lk.Gaussian with a one-element sigma, sqrt(train_Yvar) when that is given. |