Warning
This page was created from a pull request.
jax.random.dirichletΒΆ
-
jax.random.
dirichlet
(key, alpha, shape=None, dtype=<class 'numpy.float64'>)[source]ΒΆ Sample Dirichlet random values with given shape and float dtype.
- Parameters
key β a PRNGKey used as the random key.
alpha β an array of shape
(..., n)
used as the concentration parameter of the random variables.shape β optional, a tuple of nonnegative integers specifying the result batch shape; that is, the prefix of the result shape excluding the last element of value
n
. Must be broadcast-compatible withalpha.shape[:-1]
. The default (None) produces a result shape equal toalpha.shape
.dtype β optional, a float dtype for the returned values (default float64 if jax_enable_x64 is true, otherwise float32).
- Returns
A random array with the specified dtype and shape given by
shape + (alpha.shape[-1],)
ifshape
is not None, or elsealpha.shape
.