tune
tune(posterior, hyper_tuner=MarginalLikelihood())Tune a fitted posterior’s hyperparameters, without refitting.
post = lk.tune(post) # the marginal likelihood
post = lk.tune(post, lk.GridSearch(nll, values=torch.logspace(-2, 3, 21)))Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| posterior | P | The posterior. It is left unchanged. | required |
| hyper_tuner | HyperTuner | The tuner. | MarginalLikelihood() |
Returns
| Name | Type | Description |
|---|---|---|
| P | The tuned posterior, hyper_tuner(posterior). |
Raises
| Name | Type | Description |
|---|---|---|
| TypeError | hyper_tuner is not a HyperTuner (a string, a class, or None). |