Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot monitor synaptic delays #1289

Open
LjubicaCimesa opened this issue Apr 19, 2021 · 2 comments
Open

Cannot monitor synaptic delays #1289

LjubicaCimesa opened this issue Apr 19, 2021 · 2 comments

Comments

@LjubicaCimesa
Copy link

Hello,
I had some problems with my conda virtual environment and I had to delete it and create a new one, and also I had to install all the packages, including Brian. After doing so, I was not able to Monitor synaptic delays anymore by using StateMonitors. The error I get is
" return self._variables[item]
KeyError: 'delay' "
Do you happen to know why this feature disappeared?

Thank you !
Best, Ljubica Cimesa

@mstimberg
Copy link
Member

Hi. This seems to be a bug that we introduced with some internal reorganization in newer versions, sorry about that. The underlying reason is that delays are not part of the synaptic model itself, but of its "pathway", e.g. there can be a "pre" and a "post" delay. As a workaround (which also works with older versions), you can ask to directly record from the pathway itself. I.e., instead of doing

synapses = Synapses(...)
...
mon = StateMonitor(synapses, 'delay', record=True)

you use

mon = StateMonitor(synapses.pre, 'delay', record=True)

All that said: I am curious why you want to record delays with a StateMonitor over time in the first place – they do not change during the simulation, so why not simply ask for synapses.delay if you need their values?

@LjubicaCimesa
Copy link
Author

Hello,
Thanks you for your fast reply!
I wanted to monitor synaptic delays just to be sure that synapse.delay command is working. Anyways, as a test, I ran a small network with just a few neurons to see if they do have random delays, seemed to be working!
And I checked that because you can define delay within the synapse if delays are constant, by using delays=1ms for example. On the other hand, it was written in Brian documentation that if you want to have varying delays, you define them as any other variable within synapse and then set it with synapses.delays = ...
That is why I thought delays needed to be defined the same way as for example, weights/connectivity. So I also added delays:second within the model section, but this was reporting an error.
Finally because of this confusion, I wanted to monitor delays to see if they are actually set in the first place, without having "delays:second" defined within the model and using only command synapses.delay = ...

Best, Ljubica

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants