-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: `find_object()`Attribute Error Initializing a synapse with a tag for src or dst neuron group, requires tag seach to obtain the src or dst object. e.g. SynapseGroup(src='pop1', dst=pop2, ...) this search calls `find_objects()` for all objects, Therefore since a recoder haven't yet been initialized there's no attribute `variables` * style: each setting as argument for network * doc: fix missing keyword and new setup method * fix: test cuda device * feat: default for parameter * relase: bump version to 0.1.3
- Loading branch information
Showing
7 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Just like ``PymoNNto``, each ``Network`` in ``PymoNNtorch`` is composed of ``Neu | |
ng = NeuronGroup(net=net, size=1000, behavior={}) | ||
syn = SynapseGroup(net=net, src=ng, dst=ng, tag='GLUTAMATE') | ||
|
||
So far, ``ng`` has been added to network ``net`` and synaptic connection has been defined to connect ``ng`` to itself, i.e. both afferent and efferent synapses of ``ng`` are ``syn``. By default, each network and its components are created on CPU and the data type of any tensor inside the objects is set to ``torch.float32``. Pass an argument ``settings`` to the ``Network`` to change these default setups. ``settings`` is a dictionary with keys ``device`` and ``dtype`` which indicate the device and data type of everything within the network, respectively. | ||
So far, ``ng`` has been added to network ``net`` and synaptic connection has been defined to connect ``ng`` to itself, i.e. both afferent and efferent synapses of ``ng`` are ``syn``. By default, each network and its components are created on CPU and the data type of any tensor inside the objects is set to ``torch.float32``. To change these settings on creation, simply, fill the arguments of the network with your desired device and dtype. | ||
|
||
To have a functioning network, we can write ``Behavior`` (s) for different network objects to define dynamics and attributes for them. To do so, we can proceed as follows: :: | ||
|
||
|
@@ -29,7 +29,7 @@ To have a functioning network, we can write ``Behavior`` (s) for different netwo | |
firing = neurons.voltage >= self.threshold | ||
neurons.spike = firing.byte() | ||
neurons.voltage[firing] = 0.0 # reset | ||
|
||
neurons.voltage *= 0.9 # voltage decay | ||
neurons.voltage += neurons.vector(mode="uniform", density=0.1) | ||
|
||
|
@@ -52,7 +52,7 @@ Note that each behavior is given an index upon being assigned to a network objec | |
neurons.voltage += [email protected]() / synapse.src.size * 10 | ||
|
||
Now, assume we have defined ``ng`` by:: | ||
|
||
ng = NeuronGroup(net=net, | ||
size=1000, | ||
behavior={ | ||
|
@@ -74,11 +74,11 @@ In most simulations, we need to keep track of variables through time. To do so, | |
|
||
net = Network() | ||
ng = NeuronGroup(net=net, | ||
size=1000, | ||
size=1000, | ||
behavior={ | ||
1: BasicBehavior(), | ||
2: InputBehavior(), | ||
9: Recorder(['voltage', 'mean(voltage)']), | ||
9: Recorder(['voltage', 'torch.mean(voltage)']), | ||
10: EventRecorder(['spike']) | ||
}) | ||
SynapseGroup(ng, ng, net, tag='GLUTAMATE') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters