core.Likelihood
core.Likelihood()A likelihood \(p(y \mid f)\) over targets given model outputs.
The core sums positions and weights examples.
Methods
| Name | Description |
|---|---|
| log_prob | Log-likelihood \(\log p(y \mid f)\) summed over the event. |
log_prob
core.Likelihood.log_prob(f, y, /)Log-likelihood \(\log p(y \mid f)\) summed over the event.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| f | Outputs | Model outputs for a batch. | required |
| y | Targets | Targets for the same batch. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Tensor | A tensor shaped [N], or [N, *positions] (per token, say). |