logcategorical
LogCategorical
Bases: Distribution
A Geometric distribution.
Source code in hfppl/distributions/logcategorical.py
__init__(logits)
Create a Categorical distribution from unnormalized log probabilities (logits).
Given an array of logits, takes their softmax
and samples an integer in range(len(logits))
from the resulting categorical.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logits |
array
|
a numpy array of unnormalized log probabilities. |
required |