LogNormal

Contents

LogNormal#

class braintools.init.LogNormal(mean, std, unit=None)#

Log-normal distribution initialization.

Generates values from a log-normal distribution. The parameters are the desired mean and standard deviation in linear space (not log-space).

Parameters:
  • mean (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Desired mean of the distribution (in linear space).

  • std (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Desired standard deviation of the distribution (in linear space).

Examples

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