Gamma

Contents

Gamma#

class braintools.init.Gamma(shape, scale, unit=None)#

Gamma distribution initialization.

Generates values from a gamma distribution.

Parameters:
  • shape (float) – Shape parameter (k) of the gamma distribution.

  • scale (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Scale parameter (theta) of the gamma distribution.

Examples

>>> import numpy as np
>>> import brainunit as u
>>> from braintools.init import Gamma
>>>
>>> init = Gamma(shape=2.0, scale=0.5 * u.siemens)
>>> rng = np.random.default_rng(0)
>>> weights = init(1000, rng=rng)