testing.check_predictive
testing.check_predictive(predictive, posterior, inputs)Check a predictive against the core contracts.
requiresis aRequirements.- It takes a
generatorkeyword, aslk.predictcalls it. - It returns a
Distributionwhose batch shape starts with the number of examples ininputs: the leading dimension of the first input leaf, asBatch.sizecounts it. Trailing batch dimensions (outputs, sequence positions) are allowed.
Errors that the predictive raises propagate.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| predictive | Predictive[B] | The predictive. | required |
| posterior | B | The posterior to predict with. | required |
| inputs | Inputs | The inputs to predict at. | required |
Raises
| Name | Type | Description |
|---|---|---|
| AssertionError | A law above fails. The message names the law and predictive. |
|
| ValueError | inputs has no tensor leaves, or its first leaf is 0-dim. |