-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #460 from apdavison/nest-dev
Merge nest-dev into master, support for NEST 2.12.0
- Loading branch information
Showing
25 changed files
with
685 additions
and
88 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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
======================== | ||
PyNN 0.8.3 release notes | ||
======================== | ||
|
||
8th March 2017 | ||
|
||
Welcome to PyNN 0.8.3! | ||
|
||
|
||
NeuroML 2 | ||
--------- | ||
|
||
The `neuroml` module has been completely rewritten, and updated from NeuroML v1 to v2. | ||
This module works like other PyNN "backends", i.e. ``import pyNN.neuroml as sim``... | ||
but instead of running a simulation, it exports the network to an XML file in NeuroML format. | ||
|
||
NEST 2.12 | ||
--------- | ||
|
||
This release introduces support for NEST_ 2.12. Previous versions of NEST are no longer supported. | ||
|
||
|
||
Other changes | ||
------------- | ||
|
||
* `A couple of bug fixes`_ | ||
|
||
|
||
|
||
.. _Brian: http://briansimulator.org | ||
.. _`A couple of bug fixes`: https://github.com/NeuralEnsemble/PyNN/issues?q=is%3Aclosed+milestone%3A0.8.3 |
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 |
---|---|---|
@@ -0,0 +1,115 @@ | ||
""" | ||
Demonstration of the Generalized Integrate-and-Fire model described by Pozzorini et al. (2015) | ||
We simulate four neurons with different parameters: | ||
1. spike-triggered current, fixed threshold, deterministic spiking | ||
2. no spike-triggered current, dynamic threshold, deterministic spiking | ||
3 & 4. no spike-triggered current, fixed threshold, stochastic spiking | ||
Since neurons 1 and 2 have deterministic spiking, they should produce the same spike times with | ||
different simulators. Neurons 3 and 4, being stochastic, should spike at different times. | ||
Reference: | ||
Pozzorini, Christian, Skander Mensi, Olivier Hagens, Richard Naud, Christof Koch, and Wulfram Gerstner (2015) | ||
"Automated High-Throughput Characterization of Single Neurons by Means of Simplified Spiking Models." | ||
PLOS Comput Biol 11 (6): e1004275. doi:10.1371/journal.pcbi.1004275. | ||
""" | ||
|
||
import matplotlib | ||
matplotlib.use('Agg') | ||
from pyNN.utility import get_simulator, init_logging, normalized_filename | ||
|
||
|
||
# === Configure the simulator ================================================ | ||
|
||
sim, options = get_simulator(("--plot-figure", "Plot the simulation results to a file.", {"action": "store_true"}), | ||
("--debug", "Print debugging information")) | ||
|
||
if options.debug: | ||
init_logging(None, debug=True) | ||
|
||
sim.setup(timestep=0.01, min_delay=1.0) | ||
|
||
|
||
# === Build and instrument the network ======================================= | ||
|
||
t_stop = 300.0 | ||
|
||
parameters = { | ||
'neurons': { | ||
'v_rest': -65.0, # Resting membrane potential in mV. | ||
'cm': 1.0, # Capacity of the membrane in nF | ||
'tau_m': 20.0, # Membrane time constant in ms. | ||
'tau_refrac': 4.0, # Duration of refractory period in ms. | ||
'tau_syn_E': 5.0, # Decay time of the excitatory synaptic conductance in ms. | ||
'tau_syn_I': 5.0, # Decay time of the inhibitory synaptic conductance in ms. | ||
'e_rev_E': 0.0, # Reversal potential for excitatory input in mV | ||
'e_rev_I': -70.0, # Reversal potential for inhibitory input in mV | ||
'v_reset': -65.0, # Reset potential after a spike in mV. | ||
'i_offset': 0.0, # Offset current in nA | ||
'v_t_star': -55.0, # Threshold baseline in mV. | ||
'lambda0': 1.0, # Firing intensity at threshold in Hz. | ||
'tau_eta1': 1.0, # } | ||
'tau_eta2': 10.0, # } Time constants for spike-triggered current in ms. | ||
'tau_eta3': 100.0, # } | ||
'tau_gamma1': 1.0, # } | ||
'tau_gamma2': 10.0, # } Time constants for spike-frequency adaptation in ms. | ||
'tau_gamma3': 100.0, # } | ||
# the following parameters have different values for each neuron | ||
'delta_v': [1e-6, 1e-6, 0.5, 0.5], # Threshold sharpness in mV. | ||
'a_eta1': [0.1, 0.0, 0.0, 0.0], # } | ||
'a_eta2': [0.1, 0.0, 0.0, 0.0], # } Post-spike increments for spike-triggered current in nA | ||
'a_eta3': [0.1, 0.0, 0.0, 0.0], # } | ||
'a_gamma1': [0.0, 5.0, 0.0, 0.0], # } | ||
'a_gamma2': [0.0, 5.0, 0.0, 0.0], # } Post-spike increments for spike-frequency adaptation in mV | ||
'a_gamma3': [0.0, 5.0, 0.0, 0.0], # } | ||
}, | ||
'stimulus': { | ||
'start': 20.0, | ||
'stop': t_stop - 20.0, | ||
'amplitude': 0.6 | ||
} | ||
} | ||
|
||
neurons = sim.Population(4, sim.GIF_cond_exp(**parameters['neurons'])) | ||
|
||
electrode = sim.DCSource(**parameters['stimulus']) | ||
electrode.inject_into(neurons) | ||
|
||
neurons.record(['v', 'i_eta', 'v_t']) | ||
|
||
|
||
# === Run the simulation ===================================================== | ||
|
||
sim.run(t_stop) | ||
|
||
# === Save the results, optionally plot a figure ============================= | ||
|
||
filename = normalized_filename("Results", "gif_neuron", "pkl", | ||
options.simulator, sim.num_processes()) | ||
neurons.write_data(filename, annotations={'script_name': __file__}) | ||
|
||
if options.plot_figure: | ||
from pyNN.utility.plotting import Figure, Panel | ||
figure_filename = filename.replace("pkl", "png") | ||
data = neurons.get_data().segments[0] | ||
v = data.filter(name="v")[0] | ||
v_t = data.filter(name="v_t")[0] | ||
i_eta = data.filter(name="i_eta")[0] | ||
Figure( | ||
Panel(v, ylabel="Membrane potential (mV)", | ||
yticks=True, ylim=[-66, -52]), | ||
Panel(v_t, ylabel="Threshold (mV)", | ||
yticks=True), | ||
Panel(i_eta, ylabel="i_eta (nA)", xticks=True, | ||
xlabel="Time (ms)", yticks=True), | ||
annotations="Simulated with %s" % options.simulator.upper() | ||
).save(figure_filename) | ||
print(figure_filename) | ||
|
||
|
||
# === Clean up and quit ======================================================== | ||
|
||
sim.end() |
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
Oops, something went wrong.