Comments (5)
This is a bit weird - shouldn't is_active be allocated once and then assigned to by is_active[:] = ...?
from brian2.
This is a bit weird - shouldn't is_active be allocated once and then assigned to by is_active[:] = ...?
I guess this is a consequence of my previous optimisation... The is_active
calculation is now contained in the abstract code of the state update, so the state updater abstract code looks something like:
is_active = (t >= refractory_until)
_x = is_active*dt*(-x/tau) + x
x = _x
_array_x[:] = x
_array_is_active[:] = is_active
from brian2.
Ah yes, I see. OK, so that's unavoidable indeed. Well fixed in that case! ;)
from brian2.
I'll reopen this issue since I ran into it again... For variables like not_refractory
we can mostly work around this problem, but we need a general solution. An example use case that currently fails (in Python): The user defines a boolean parameter channel_active
in the model and uses this as part of the equations. During the equation rewriting done by sympy for the state update step, the expression -channel_active
might appear which will not work as expected. I think we need to fix this in the numpy language by always loading boolean variables as 1 * variable
.
from brian2.
I've dealt with this by explicitly introducing an int_
function (it was easier not calling it int
, we can change this later if we want to) that should be used whenever a boolean variable or expression has to be interpreted in a 0/1 sense (i.e. in particular in model equations). The refractory variable is used in the correct way now.
from brian2.
Related Issues (20)
- "python setup.py install" error HOT 1
- Dynamic delays during a run HOT 3
- Incompatible with numpy version >= 1.20 due to deprecated aliases HOT 5
- SpatialNeuron (spatialstateupdate) fails with numpy without scipy HOT 7
- Improve parser for model descriptions HOT 1
- Improve the MarkDown exporter
- Use randomised timesteps to avoid artificial synchronisation
- Improve Pyodide support
- [Question] Regarding the spatial neuron equation HOT 2
- GSL incompatibility with latest Cython beta
- Problem with storing Neurongroups in dictionaries HOT 1
- the Izhikevich_2007 example neuron model bug HOT 4
- [readthedocs] Tutorials disappeared HOT 2
- Random number generation on C++ standalone is slow HOT 3
- [beginner question]step through brian2 to understand inner workings of neuronal models HOT 1
- Setting Neuron weights? HOT 2
- Floor division of integer values sometimes incorrect on C++ standalone
- Returned value needs to be retrieved for object to work HOT 7
- A bug in the Synapse.connect documentation HOT 2
- module 'brian2' has no attribute 'units' HOT 2
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 brian2.