TruncatedNormal#
- class brainpy.initialize.TruncatedNormal(loc=0.0, scale=1.0, lower=None, upper=None, seed=None)[source]#
Initialize weights with truncated normal distribution.
- Parameters:
loc (float, ndarray) – Mean (“centre”) of the distribution before truncating. Note that the mean of the truncated distribution will not be exactly equal to
loc
.scale (float) – The standard deviation of the normal distribution before truncating.
lower (float, ndarray) –
- A float or array of floats representing the lower bound for
truncation. Must be broadcast-compatible with
upper
.
upper (float, ndarray) – A float or array of floats representing the upper bound for truncation. Must be broadcast-compatible with
lower
.