Neurons#
Subpackages#
Submodules#
conex.behaviors.neurons.axon module#
Axon mechanisms for neurons.
- class conex.behaviors.neurons.axon.NeuronAxon(*args, max_delay=1, proximal_min_delay=0, distal_min_delay=0, apical_min_delay=0, **kwargs)[source]#
Bases:
BehaviorPropagate the spikes and apply the delay mechanism.
Note: should be added after fire.
- Parameters:
max_delay (int) – Maximum delay of all dendrites connected to the neurons. This value determines the delay buffer size.
proximal_min_delay (int) – Minimum delay of proximal dendrites. The default is 0.
distal_min_delay (int) – Minimum delay of distal dendrites. The default is 0.
apical_min_delay (int) – Minimum delay of apical dendrites. The default is 0.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
conex.behaviors.neurons.dendrite module#
Dendrite structure and computation variants.
- class conex.behaviors.neurons.dendrite.SimpleDendriteStructure(*args, Proximal_max_delay=1, Distal_max_delay=1, Apical_max_delay=None, proximal_min_delay=0, distal_min_delay=0, apical_min_delay=None, **kwargs)[source]#
Bases:
BehaviorDefines the Structure of the dendrite. Gathers currents for the Computation Behavior.
- Parameters:
proximal_max_delay (int) – Maximum delay of proximal dendrites. The default is 1. Set this to 0 to discard Proximal dendrite.
distal_max_delay (int) – Maximum delay of distal dendrites. The default is 1. Set this to 0 to discard Distal dendrite.
apical_max_delay (int) – Maximum delay of distal dendrites. The default is distal_max_delay + 1. Set this to 0 to discard Apical dendrite.
proximal_min_delay (int) – Minimum delay of proximal dendrites. The default is 0.
distal_min_delay (int) – Minimum delay of distal dendrites. The default is 0.
apical_min_delay (int) – Minimum delay of apical dendrites. The default is distal_min_delay + 1.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
- class conex.behaviors.neurons.dendrite.SimpleDendriteComputation(*args, I_tau=None, apical_provocativeness=None, distal_provocativeness=None, **kwargs)[source]#
Bases:
BehaviorSums the different kind of dendrite entering the neurons.
- Parameters:
apical_provocativeness (float) – The strength of the apical dendrites. The default is None.
distal_provocativeness (float) – The strength of the distal dendrites. The default is None.
I_tau (float) – Decaying factor to current. If None, at each step, current falls to zero.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
conex.behaviors.neurons.homeostasis module#
- class conex.behaviors.neurons.homeostasis.ActivityBaseHomeostasis(activity_rate, window_size, updating_rate, *args, decay_rate=1.0, **kwargs)[source]#
Bases:
BehaviorHomeostasis Based on the target activity of neurons.
Note: Threshold of neurons should be a population size tensor.
- Parameters:
window_size (int) – The simulation steps to accumulate spikes.
activity_rate (int) – The expected number of spikes in a window.
updating_rate (float) – A scaler to change update effect with.
decay_rate (float) – A scaler to change updating_rate after each applied homeostasis. The default is 1.0
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
- class conex.behaviors.neurons.homeostasis.VoltageBaseHomeostasis(*args, target_voltage=None, max_ta=None, min_ta=None, eta_ip=0.001, **kwargs)[source]#
Bases:
BehaviorHomeostasis base on the voltage rate of Neurons.
- Parameters:
target_voltage (float) – The expected voltage of neuron. Defaults to None.
max_ta (float) – The desired maximum voltage for a neuron. If not provided, the value of target_voltage is used.
min_ta (float) – The desired minimum voltage for a neuron. If not provided, the value of target_voltage is used.
eta_ip (flaot) – The updating speed of the homeostasis process. The default is 0.001.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
conex.behaviors.neurons.setters module#
Helper behaviors to communicate with input and output layers
- class conex.behaviors.neurons.setters.SensorySetter(*args, **kwargs)[source]#
Bases:
BehaviorGets input from Layer Object and sets as spike for the population.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
- class conex.behaviors.neurons.setters.LocationSetter(*args, **kwargs)[source]#
Bases:
BehaviorGets location from Layer Object and sets as spike for the population.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
conex.behaviors.neurons.specs module#
General specifications needed for spiking neurons.
- class conex.behaviors.neurons.specs.InherentNoise(*args, mode='rand', scale=1, offset=0, **kwargs)[source]#
Bases:
BehaviorApplies noisy voltage to neurons in the population.
- Parameters:
mode (str) – Mode to be used in initialize the tensor. Accepts similar values to Pymonntorch’s tensor function. Defaults to “rand”.
scale (float) – Scale factor to multiply to the tensor. Default is 1.0.
offset (function) – An offset value to be added to the tensor. Default is 0.0.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
- class conex.behaviors.neurons.specs.Fire(*args, **kwargs)[source]#
Bases:
BehaviorAsks neurons to Fire.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#
- class conex.behaviors.neurons.specs.KWTA(k, *args, dimension=None, **kwargs)[source]#
Bases:
BehaviorKWTA behavior of spiking neurons:
if v >= threshold then v = v_reset and all other spiked neurons are inhibited.
Note: Population should be built by NeuronDimension. and firing behavior should be added too.
- Parameters:
k (int) – number of winners.
dimension (int, optional) – K-WTA on specific dimension. defaults to None.
- initialize(neurons)[source]#
Sets the variables of the object. This method is called by the Network class when the object is added to the network.
Note: All sub-classes of Behavior overriding this method should call the super method to ensure everything is placed on the correct device.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- forward(neurons)[source]#
Forward pass of the behavior. This method is called by the Network class per simulation iteration.
- Parameters:
object (TaggableObject) – Object possessing the behavior.
- training: bool#