Comments (6)
As would facilitate using SpiNNaker to speed up optimization.
from neuronunit.
PyNN is not a self sufficient backend, it, itself uses BRIAN, NEST or NEURON as a backend.
However this is still a worthwhile pursuit as PyNN provides a very clean and minimal interface to NEURON.
Example of a pyNN NEURON backend as I envisage:
class pyNNNEURON(Backend):
def init_backend(self, attrs=None):
from pyNN.utility import get_simulator#, init_logging, normalized_filename
import pyNN
self.sim = pyNN.neuron
self.neurons = None
self.model_path = None
self.related_data = {}
self.lookup = {}
self.attrs = {}
backend = 'pyNN'
from numpy import arange
self.sim.setup(timestep=0.01, min_delay=1.0) |
self.neurons = sim.Population(1, sim.Izhikevich(a=0.02, b=0.2, c=-65, d=6, i_offset=[0.014, 0.0, 0.0]))
def get_membrane_potential(self):
data = self.neurons.get_data().segments[0]
v = data.filter(name="v")[0]
def local_run(self):
self.neurons.record(['v']) # , 'u'])
self.neurons.initialize(v=-70.0, u=-14.0)
self.sim.run(100.0)
def set_attrs(self, **attrs):
self.model.attrs.update(attrs)
assert type(self.model.attrs) is not type(None)
self.neurons = sim.Population(1, sim.Izhikevich(a=attrs['a'], b=attrs['b'], c=attrs['c'], d=attrs['d'], i_offset=[0.014, 0.0, 0.0]))
return self
def inject_square_current(self, current):
c = current['injected_square_current']
stop = c['delay']+c['duration']
amplitude = current[]
electrode = self.sim.DCSource(start=c['delay'], stop=stop, amplitude=c['amplitude'])
electrode.inject_into(self.neurons[1])
The main problem is that the backend is not model independent. Models are not implemented in PyNN code rather, models are declared and provided as parameter to the backend. For example in the above code:
sim.Izhikevich(a=attrs['a'], b=attrs['b'], c=attrs['c'], d=attrs['d'], i_offset=[0.014, 0.0, 0.0]))
from neuronunit.
@russelljjarvis
I think this is a good start. In some cases this may be the very easiest way to work with the models, since NEURON commands can be confusing and cryptic, and PyNN may abstract some of this away.
To deal with model independence, we will have to rely on the user providing a lot of the PyNN code themselves. For example, maybe we leave self.neurons empty and if a method tries to access it we raise an Exception that says "You have to set the neurons attribute to a valid PyNN object", so then the user is responsible for things like neurons = sim.Population(1, sim.Izhikevich(a=0.02, b=0.2, c=-65, d=6, i_offset=[0.014, 0.0, 0.0]))
Then in addition to this we can provide helper functions to make some of this easier, e.g. automatically setting a
, b
, c
, etc. from the attrs
dictionary.
Surely we cannot anticipate all the uses of PyNE, but if we have an example working with this model (like we have one working with jNeuroML with NEURON) then it will provide a roadmap for others to follow.
Let's leave this for after the 0.2 release.
from neuronunit.
AOK.
from neuronunit.
See also duplicate issue #168.
from neuronunit.
Closing as duplicate of more specific #168.
from neuronunit.
Related Issues (20)
- Use Allen Features to optimize HOT 11
- newer test class for passive elephant tests breaks parallelism in dask, in the case of brian2 backend. HOT 4
- Documenting all Score edge cases that break optimization gradients HOT 3
- A document Notice to debug set PARALLEL_CONFIDENT=False
- Test Suites should be dictionaries not lists. HOT 7
- Use standardized units throughout
- Sciunit judge no longer works with static Models. How can I opt of using the ProtocolToFeaturesTest? HOT 8
- Druckmann Tests are not proper tests
- Confirm that NeuronUnits jNeuromLB backend really can be regarded as a ground truth. HOT 7
- NU test.protocol should be flat or more predictable to traverse.
- Major NU interface redesigns could come with interface diagrams.
- documentation chapters of NeuronUnit should be upgraded to Unit Tests via pytest-ipynb
- 2.5 different code locations that determine sim_length need to be collapsed into one.
- Duplicated content injected current test protocol/parameter
- Installation Fails on Windows HOT 1
- create branch optimization based on dev, that I can merge pull requests into. HOT 2
- Migrate away from travis HOT 2
- Merge error in backend __init__.py HOT 2
- Missing closing ' HOT 1
- Relax constraints on install requirements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuronunit.