Uniform

Contents

Uniform#

class braintools.init.Uniform(low, high, unit=None)#

Uniform distribution initialization.

Generates values uniformly distributed between low and high.

Parameters:
  • low (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Lower bound (inclusive).

  • high (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Upper bound (exclusive).

Examples

>>> import numpy as np
>>> import brainunit as u
>>> from braintools.init import Uniform
>>>
>>> init = Uniform(0.1 * u.siemens, 1.0 * u.siemens)
>>> rng = np.random.default_rng(0)
>>> weights = init(1000, rng=rng)