bindsnet.models package

Submodules

bindsnet.models.models module

class bindsnet.models.models.DiehlAndCook2015(n_inpt: int, n_neurons: int = 100, exc: float = 22.5, inh: float = 17.5, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, wmin: float = 0.0, wmax: float = 1.0, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, inpt_shape: Optional[Iterable[int]] = None)[source]

Bases: bindsnet.network.network.Network

Implements the spiking neural network architecture from (Diehl & Cook 2015).

Constructor for class DiehlAndCook2015.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of excitatory, inhibitory neurons.
  • exc – Strength of synapse weights from excitatory to inhibitory layer.
  • inh – Strength of synapse weights from inhibitory to excitatory layer.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on input to excitatory synapses.
  • wmax – Maximum allowed weight on input to excitatory synapses.
  • norm – Input to excitatory layer connection weights normalization constant.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • inpt_shape – The dimensionality of the input layer.
class bindsnet.models.models.DiehlAndCook2015v2(n_inpt: int, n_neurons: int = 100, inh: float = 17.5, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, wmin: Optional[float] = 0.0, wmax: Optional[float] = 1.0, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, inpt_shape: Optional[Iterable[int]] = None)[source]

Bases: bindsnet.network.network.Network

Slightly modifies the spiking neural network architecture from (Diehl & Cook 2015) by removing the inhibitory layer and replacing it with a recurrent inhibitory connection in the output layer (what used to be the excitatory layer).

Constructor for class DiehlAndCook2015v2.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of excitatory, inhibitory neurons.
  • inh – Strength of synapse weights from inhibitory to excitatory layer.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on input to excitatory synapses.
  • wmax – Maximum allowed weight on input to excitatory synapses.
  • norm – Input to excitatory layer connection weights normalization constant.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • inpt_shape – The dimensionality of the input layer.
class bindsnet.models.models.IncreasingInhibitionNetwork(n_input: int, n_neurons: int = 100, start_inhib: float = 1.0, max_inhib: float = 100.0, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, wmin: float = 0.0, wmax: float = 1.0, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, inpt_shape: Optional[Iterable[int]] = None)[source]

Bases: bindsnet.network.network.Network

Implements the inhibitory layer structure of the spiking neural network architecture from (Hazan et al. 2018)

Constructor for class IncreasingInhibitionNetwork.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of excitatory, inhibitory neurons.
  • inh – Strength of synapse weights from inhibitory to excitatory layer.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on input to excitatory synapses.
  • wmax – Maximum allowed weight on input to excitatory synapses.
  • norm – Input to excitatory layer connection weights normalization constant.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • inpt_shape – The dimensionality of the input layer.
class bindsnet.models.models.LocallyConnectedNetwork(n_inpt: int, input_shape: List[int], kernel_size: Union[int, Tuple[int, int]], stride: Union[int, Tuple[int, int]], n_filters: int, inh: float = 25.0, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, wmin: float = 0.0, wmax: float = 1.0, norm: Optional[float] = 0.2)[source]

Bases: bindsnet.network.network.Network

Defines a two-layer network in which the input layer is “locally connected” to the output layer, and the output layer is recurrently inhibited connected such that neurons with the same input receptive field inhibit each other.

Constructor for class LocallyConnectedNetwork. Uses DiehlAndCookNodes to avoid multiple spikes per timestep in the output layer population.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • input_shape – Two-dimensional shape of input population.
  • kernel_size – Size of input windows. Integer or two-tuple of integers.
  • stride – Length of horizontal, vertical stride across input space. Integer or two-tuple of integers.
  • n_filters – Number of locally connected filters per input region. Integer or two-tuple of integers.
  • inh – Strength of synapse weights from output layer back onto itself.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on Input to DiehlAndCookNodes synapses.
  • wmax – Maximum allowed weight on Input to DiehlAndCookNodes synapses.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • normInput to DiehlAndCookNodes layer connection weights normalization constant.
class bindsnet.models.models.TwoLayerNetwork(n_inpt: int, n_neurons: int = 100, dt: float = 1.0, wmin: float = 0.0, wmax: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, norm: float = 78.4)[source]

Bases: bindsnet.network.network.Network

Implements an Input instance connected to a LIFNodes instance with a fully-connected Connection.

Constructor for class TwoLayerNetwork.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of neurons in the LIFNodes population.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on Input to LIFNodes synapses.
  • wmax – Maximum allowed weight on Input to LIFNodes synapses.
  • normInput to LIFNodes layer connection weights normalization constant.

Module contents

class bindsnet.models.TwoLayerNetwork(n_inpt: int, n_neurons: int = 100, dt: float = 1.0, wmin: float = 0.0, wmax: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, norm: float = 78.4)[source]

Bases: bindsnet.network.network.Network

Implements an Input instance connected to a LIFNodes instance with a fully-connected Connection.

Constructor for class TwoLayerNetwork.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of neurons in the LIFNodes population.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on Input to LIFNodes synapses.
  • wmax – Maximum allowed weight on Input to LIFNodes synapses.
  • normInput to LIFNodes layer connection weights normalization constant.
class bindsnet.models.DiehlAndCook2015v2(n_inpt: int, n_neurons: int = 100, inh: float = 17.5, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, wmin: Optional[float] = 0.0, wmax: Optional[float] = 1.0, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, inpt_shape: Optional[Iterable[int]] = None)[source]

Bases: bindsnet.network.network.Network

Slightly modifies the spiking neural network architecture from (Diehl & Cook 2015) by removing the inhibitory layer and replacing it with a recurrent inhibitory connection in the output layer (what used to be the excitatory layer).

Constructor for class DiehlAndCook2015v2.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of excitatory, inhibitory neurons.
  • inh – Strength of synapse weights from inhibitory to excitatory layer.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on input to excitatory synapses.
  • wmax – Maximum allowed weight on input to excitatory synapses.
  • norm – Input to excitatory layer connection weights normalization constant.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • inpt_shape – The dimensionality of the input layer.
class bindsnet.models.DiehlAndCook2015(n_inpt: int, n_neurons: int = 100, exc: float = 22.5, inh: float = 17.5, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, wmin: float = 0.0, wmax: float = 1.0, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, inpt_shape: Optional[Iterable[int]] = None)[source]

Bases: bindsnet.network.network.Network

Implements the spiking neural network architecture from (Diehl & Cook 2015).

Constructor for class DiehlAndCook2015.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of excitatory, inhibitory neurons.
  • exc – Strength of synapse weights from excitatory to inhibitory layer.
  • inh – Strength of synapse weights from inhibitory to excitatory layer.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on input to excitatory synapses.
  • wmax – Maximum allowed weight on input to excitatory synapses.
  • norm – Input to excitatory layer connection weights normalization constant.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • inpt_shape – The dimensionality of the input layer.
class bindsnet.models.IncreasingInhibitionNetwork(n_input: int, n_neurons: int = 100, start_inhib: float = 1.0, max_inhib: float = 100.0, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, wmin: float = 0.0, wmax: float = 1.0, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, inpt_shape: Optional[Iterable[int]] = None)[source]

Bases: bindsnet.network.network.Network

Implements the inhibitory layer structure of the spiking neural network architecture from (Hazan et al. 2018)

Constructor for class IncreasingInhibitionNetwork.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • n_neurons – Number of excitatory, inhibitory neurons.
  • inh – Strength of synapse weights from inhibitory to excitatory layer.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on input to excitatory synapses.
  • wmax – Maximum allowed weight on input to excitatory synapses.
  • norm – Input to excitatory layer connection weights normalization constant.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • inpt_shape – The dimensionality of the input layer.
class bindsnet.models.LocallyConnectedNetwork(n_inpt: int, input_shape: List[int], kernel_size: Union[int, Tuple[int, int]], stride: Union[int, Tuple[int, int]], n_filters: int, inh: float = 25.0, dt: float = 1.0, nu: Union[float, Sequence[float], None] = (0.0001, 0.01), reduction: Optional[callable] = None, theta_plus: float = 0.05, tc_theta_decay: float = 10000000.0, wmin: float = 0.0, wmax: float = 1.0, norm: Optional[float] = 0.2)[source]

Bases: bindsnet.network.network.Network

Defines a two-layer network in which the input layer is “locally connected” to the output layer, and the output layer is recurrently inhibited connected such that neurons with the same input receptive field inhibit each other.

Constructor for class LocallyConnectedNetwork. Uses DiehlAndCookNodes to avoid multiple spikes per timestep in the output layer population.

Parameters:
  • n_inpt – Number of input neurons. Matches the 1D size of the input data.
  • input_shape – Two-dimensional shape of input population.
  • kernel_size – Size of input windows. Integer or two-tuple of integers.
  • stride – Length of horizontal, vertical stride across input space. Integer or two-tuple of integers.
  • n_filters – Number of locally connected filters per input region. Integer or two-tuple of integers.
  • inh – Strength of synapse weights from output layer back onto itself.
  • dt – Simulation time step.
  • nu – Single or pair of learning rates for pre- and post-synaptic events, respectively.
  • reduction – Method for reducing parameter updates along the minibatch dimension.
  • wmin – Minimum allowed weight on Input to DiehlAndCookNodes synapses.
  • wmax – Maximum allowed weight on Input to DiehlAndCookNodes synapses.
  • theta_plus – On-spike increment of DiehlAndCookNodes membrane threshold potential.
  • tc_theta_decay – Time constant of DiehlAndCookNodes threshold potential decay.
  • normInput to DiehlAndCookNodes layer connection weights normalization constant.