- jax.random.choice(key, a, shape=(), replace=True, p=None, axis=0)#
Generates a random sample from a given array.
phas fewer non-zero elements than the requested number of samples, as specified in
replace=False, the output of this function is ill-defined. Please make sure to use appropriate inputs.
complex]) – array or int. If an ndarray, a random sample is generated from its elements. If an int, the random sample is generated as if a were arange(a).
bool) – boolean. Whether the sample is with or without replacement. default is True.
None]) – 1-D array-like, The probabilities associated with each entry in a. If not given the sample assumes a uniform distribution over all entries in a.
int) – int, optional. The axis along which the selection is performed. The default, 0, selects by row.
- Return type
An array of shape shape containing samples from a.