brainpy.initialize module#

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

Base Class#


Base Initialization Class.


The superclass of Initializers that initialize the weights between two layers.


The superclass of Initializers that initialize the weights within a layer.

Regular Initializers#


Zero 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.