core.HasSample
core.HasSample()Sampling of targets, used by the sampled and MC Fishers.
Methods
| Name | Description |
|---|---|
| sample | Draw targets \(y \sim p(y \mid f)\). |
sample
core.HasSample.sample(f, /, *, generator=None)Draw targets \(y \sim p(y \mid f)\).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| f | Outputs | Model outputs for a batch. | required |
| generator | torch.Generator | None | The generator to draw with, on \(f\)’s device. None means torch’s global RNG. |
None |
Returns
| Name | Type | Description |
|---|---|---|
| Targets | One draw of targets for the batch, shaped like real targets. |