standard_exponential

standard_exponential#

class braincore.random.standard_exponential(size=None, key=None, dtype=None)[source]#

Draw samples from the standard exponential distribution.

standard_exponential is identical to the exponential distribution with a scale parameter of 1.

Parameters:
  • size (int or tuple of ints, optional) – Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned.

  • key (PRNGKey, optional) – The key for the random number generator. If not given, the default random number generator is used.

Returns:

out – Drawn samples.

Return type:

float or ndarray

Examples

Output a 3x8000 array:

>>> n = braincore.random.standard_exponential((3, 8000))