brainpy.initialize module#

This module provides methods to initialize weights. You can access them through brainpy.init.XXX.

Basic Initialization Classes#


Base Initialization Class.

Regular Initializers#


Zero initializer.


Constant initializer.


One initializer.


Returns the identity matrix.

Random Initializers#

Normal([mean, scale, seed])

Initialize weights with normal distribution.

Uniform([min_val, max_val, seed])

Initialize weights with uniform distribution.

VarianceScaling(scale, mode, distribution[, ...])

KaimingUniform([scale, mode, distribution, ...])

KaimingNormal([scale, mode, distribution, ...])

XavierUniform([scale, mode, distribution, ...])

XavierNormal([scale, mode, distribution, ...])

LecunUniform([scale, mode, distribution, ...])

LecunNormal([scale, mode, distribution, ...])

Orthogonal([scale, axis, seed])

Construct an initializer for uniformly distributed orthogonal matrices.

DeltaOrthogonal([scale, axis])

Construct an initializer for delta orthogonal kernels; see arXiv:1806.05393.

Decay Initializers#

GaussianDecay(sigma, max_w[, min_w, ...])

Builds a Gaussian connectivity pattern within a population of neurons, where the weights decay with gaussian function.

DOGDecay(sigmas, max_ws[, min_w, ...])

Builds a Difference-Of-Gaussian (dog) connectivity pattern within a population of neurons.