Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 17:07
    mstimberg commented #1047
  • Jan 30 2019 16:53
    thesamovar commented #1047
  • Jan 30 2019 15:40
    mstimberg commented #1047
  • Jan 30 2019 12:16
    daphn3cor closed #1048
  • Jan 30 2019 12:15
    daphn3cor commented #1048
  • Jan 30 2019 10:33
    mstimberg synchronize #1047
  • Jan 30 2019 10:33

    mstimberg on function_compiler_kwds

    Add .c and .pxd to the list of … Make Cython compilation quiet a… (compare)

  • Jan 30 2019 09:57
    mstimberg edited #1047
  • Jan 30 2019 09:56
    mstimberg synchronize #1047
  • Jan 30 2019 09:56

    mstimberg on function_compiler_kwds

    Document the new features for u… (compare)

  • Jan 30 2019 09:56
    mstimberg commented #1048
  • Jan 30 2019 07:59
    daphn3cor commented #1048
  • Jan 29 2019 16:30
    mstimberg commented #1048
  • Jan 29 2019 15:42
    daphn3cor opened #1048
  • Jan 29 2019 14:44
    mstimberg synchronize #1047
  • Jan 29 2019 14:44

    mstimberg on function_compiler_kwds

    Include external source files a… (compare)

  • Jan 29 2019 13:48
    mstimberg synchronize #1047
  • Jan 29 2019 13:48

    mstimberg on function_compiler_kwds

    Minor bug-fixes for new additio… Support external source files f… Add tests for functions with ex… (compare)

  • Jan 25 2019 17:34
    thesamovar commented #1047
  • Jan 25 2019 17:26
    mstimberg opened #1047
wxie2013
@wxie2013
Hi @mstimberg , It turns out to be the sequence of import as indicated in the message. import setuptools before brian2 cleaned up the warning message.
Marcel Stimberg
@mstimberg
Yes, that's a workaround. But I checked again, this is a problem in very specific versions of setuptools only (>=v49.2.0 and <v49.3.1), you won't see this warning with an up-to-date setuptools (see https://github.com/brian-team/brian2/issues/1213).
wxie2013
@wxie2013
I see. Thanks for the follow up.
wxie2013
@wxie2013

Hi @Willam_Xavier. This project is about working on the Brian2GeNN interface so that it supports more of GeNN’s features. Except for unforeseen bug fixes, etc., it should not involve changing anything on GeNN’s side. All that said, please note that the application deadline for this year’s Google Summer of Code was on April 19th…

Hi @mstimberg , I thought GeNN doesn't support heterogeneous synapses delays. Is that right GeNN actually does support the feature and one just need to add another interface to bridge Brian2 and GeNN?

Marcel Stimberg
@mstimberg:matrix.org
[m]
Hi @wxie2013: GeNN did not support heterogeneous delays back when Brian2GeNN was created, but it does now. So Brian2GeNN needs changes to support this feature, i.e. translate heterogeneous Brian delays into the format that GeNN works with.
wxie2013
@wxie2013
The message from @neworderofjamie in this thread is a bit confusing:
brian-team/brian2genn#109
Does that mean the delay in GeNN are dendritic instead of axonal? He also mentioned that "they don't necessarily play well with STDP as back-propogating postsynaptic spikes can't be delayed heterogeneosuly to match". Would you please clarify that a bit?
Rihana Naderi
@RNaderi
Hi there, I have some doubts about usage of "summed" . Consider a simple example : syn=Synapse(G,G, 'v_post=v_pre :1 (summed) , syn.i=[0,0,1] , syn.j=[1,2,2] . 1)Here, is v for neuron 2 the sum of v for neuron 0 and v for neuron 1 ? 2) If I remove "summed", how v_2 is interpreted? Thank in advance.
Marcel Stimberg
@mstimberg

The message from @neworderofjamie in this thread is a bit confusing:
brian-team/brian2genn#109
Does that mean the delay in GeNN are dendritic instead of axonal? He also mentioned that "they don't necessarily play well with STDP as back-propogating postsynaptic spikes can't be delayed heterogeneosuly to match". Would you please clarify that a bit?

I always find "axonal" and "dendritic" delays a bit confusing, since in most models, e.g. something like on_pre='ge_post += w', it does not change anything. In Brian, if you set a delay, it is axonal in the sense that we wait for that time before applying the statement. This also means that if your on_pre refers to some pre-synaptic neuronal variable, this is taken at the time when the spike arrives, i.e. after the delay. You'd have to apply a workaround to describe something where it should store a pre-synaptic variable at the spike time and only apply it after a delay on the post-synaptic side. I'm actually not quite sure what it means in GeNN that the delay is dendritic, since AFAICT the synaptic model with delay does not support any access to neuronal variables, so all this should not matter.
For STDP, things are very different. The effictive time difference between the pre- and post-synaptic spike depends on the difference between the axonal delay (time after which the pre-synaptic spike arrives at the synapse) and the dendritic delay (time after with the post-synaptic spike arrives at the synapse). In Brian, you can set synapses.pre.delay and synapses.post.delay independently, but GeNN does not have such a mechanism.

4 replies
Marcel Stimberg
@mstimberg

Hi there, I have some doubts about usage of "summed" . Consider a simple example : syn=Synapse(G,G, 'v_post=v_pre :1 (summed) , syn.i=[0,0,1] , syn.j=[1,2,2] . 1)Here, is v for neuron 2 the sum of v for neuron 0 and v for neuron 1 ? 2)

Hi. Yes, the summed variable here means that at every time step, you sum over all v_pre values for the neurons connecting to a neuron. So with your connection pattern, neuron 0 does not receive any input, its v will therefore set to 0, neuron 1 receives input from neuron 0 and its v will therefore be set to the same value, and v for neuron 1 is the sum of v for neurons 1 and 2. The situation is a bit odd, though, normally you do not tuse he same variable of the same group on the left- and the right-hand side. Basically, here inevitably everything will be 0.

If I remove "summed", how v_2 is interpreted? Thank in advance.

What is v_2? You cannot remove (summed) in the above equations, just stating v_post = v_pre : 1 is not allowed/meaningful.

Rihana Naderi
@RNaderi
You are right. Could you please take a look at this example : https://brian2.readthedocs.io/en/stable/examples/frompapers.Stimberg_et_al_2018.example_4_synrel.html My question is if I remove "summed" here, how Y_S for each post synaptic neuron is interpreted.
Marcel Stimberg
@mstimberg
You cannot remove summed in that example either. It says Y_S_post = Y_S_pre, but in general there is more than one pre-synaptic Y_S for each post-synaptic Y_S, since more than one neuron on the pre-synaptic side can be connected to a post-synaptic neuron (in that example, it is synapses and astrocytes, but the same reasoning applies). So Y_S_post = Y_S_pre does not make sense. With (summed) it is interpreted as Y_S_post = sum(Y_S_pre), where the sum is over all the pre-synaptic elements connecting to the post-synaptic element. This is defined regardless of how many connections there are.
Rihana Naderi
@RNaderi
Actually, my question is for another purpose. In this example each synapse has a different astrocyte, also each post-synaptic neuron is connected to only one pre-synaptic one, so I feel it doesn't matter considering "summed" or not. I have a scenario which each synapse should assign to an astrocyte as a supervisor and because of computational reasons, I assumed some of synapses have the same astrocytes. Consider synapse 0 and synapse 1 ( neuron 0 to neuron 1 : synapse 0 and neuron 4 to neuron 1 : synapse 1) , both synapses are supervised by astrocyte 0. Y_S resulting from synapse 0 is different from 1. Do I suppose the effect of releasing Y_S on activating astrocyte from both synapses independently ? In the last example ( astro-neuron network), I can see the effect of Y_S from several synapse are summed, and then divide by the incoming connections. I think this is not true and it should be considered different from each synapse( So I should remove "summed" from the code line so that this affect each astrocyte differently ). what is your opinion?
Marcel Stimberg
@mstimberg
I have to admit I still do not understand. If a single astrocyte supervises two synapses and only has a single Y_S variable, how can it treat the two synapses differently? I mean, you can for example multiply the Y_S on the pre-synaptic side with a weight to have one of them influence the Y_S of the astrocyte more strongly than the other, but in the end the two values need to be combined into a single value, no?
wxie2013
@wxie2013
Brian2.5 is provided for Python 3.7–3.10. Is it possible to install it in python3.6?
Marcel Stimberg
@mstimberg:matrix.org
[m]
I don't remember whether we use any Python 3.7 feature already, so it might be possible to install. You should be able to do it with pip asking it to not use binary wheels and use an option like --ignore-python-requires.
wxie2013
@wxie2013

The installation works fine but when importing it, it gives the following error:

import brian2
Importing sympy failed: 'Python version 3.7 or above is required for SymPy.'
Traceback (most recent call last):

looks like brian2.5 does use python 3.7 in this case.
Marcel Stimberg
@mstimberg:matrix.org
[m]
The error message says that sympy needs 3.7 at least, but you are on 3.6. You need to install an older version of sympy that still works. The same might be necessary for numpy and other packages. Brian follows the same policy for Python version support, all newest releases of scientific python packages require python 3.7
wxie2013
@wxie2013
Thanks Marcel.
linusconrad
@linusconrad

Hello there, I am trying right now to fit some VC data I have to model using the brian2 modelfitter, however it fails to find good solutions (that might have many reasons). I cam across the following in the docs
Reference the target values in the equations

"A model can refer to the target output values within the equations. For example, if you are fitting a membrane potential trace v (i.e. output_var='v'), then the equations can refer to the target trace as v_target. This allows you for example to add a coupling term like coupling*(v_target - v) to the equation for v, pulling the trajectory towards the correct solution."

This seems like something that could increase my chances however I do not understand where and how in a model this term would be included and how the fitter would refer to it.
Can somebody enlighten me with an example on how these coupling terms can work?
Thank you so much in advance.

Marcel Stimberg
@mstimberg
Hi @linusconrad , we did not document this feature very well, but I should have an example somewhere. I'll try to clean it and upload it later today (please ping me tomorrow if I forget :-) )
Marcel Stimberg
@mstimberg
So I actually did not find a proper example, but here's the basic idea how you could adapt the hh_nevergrad_runtime.py example:
You adapt the equations so that there is an additional current that pulls the simulated v to the target v. In the first iterations, this coupling is very strong (i.e. the simulated v will be close to the target v, even for bad parameter values), and then the coupling conductance gets weaker and weaker:
dv/dt = (gl*(El-v) - g_na*(m*m*m)*h*(v-ENa) - g_kd*(n*n*n*n)*(v-EK) + I + g_coupling*(v_target - v))/Cm : volt
g_coupling = 100*nS/(iteration + 1) : siemens
1 reply
Here, v_target is provided by brian2modelfitting and equal to the target v for every time step, and iteration is automatically set to the iteration of the fitting algorithm (starting with 0).
Marcel Stimberg
@mstimberg
If you want to generate traces with the generate function you have to be a bit careful, since it does not exactly correspond to what the fitting algorithm did. In generate, the iteration variable is set to 1e9 by default (i.e. in the above example, g_coupling would be basically 0). The idea is that for the "real" result you are interested in you want to ignore the coupling term, but it would be annoying if you would have to change the model equations to deal with this. If you want to generate exactly the trace that the fitting algorithm used, then you have to set its iteration argument to the corresponding value (e.g. 49 if you wan the fitting for 50 iterations). Hope that makes things a bit clearer!
wxie2013
@wxie2013
would you please provide an example using brain2genn with delay?
in the "def fill_with_array" fuction of "device.py", it allows a scalar delay to be assigned but directly setting a delay in Brian2, i.e. S.delay='1*ms' will trigger the NotImplementedError. What command should it be to assign a common delay for all syns in a Brian2 script?
Marcel Stimberg
@mstimberg:matrix.org
[m]
Hi @wxie2013: For delays that are the same across synapses you should declare it as part of the Synapses initializer, i.e. S = Synapses(..., delay=1*ms).
wxie2013
@wxie2013
Thanks Marcel
Brian Simms
@BrianSi84300626_twitter
So what’s this all about Send
Seems like its aimed at my brain send
wxie2013
@wxie2013
I'm trying the following user-defined functions in standalone mode, the run throw the error "use standalone mode". Would you please provide some hints on how to use the implementation correctly?
    from brian2 import *

    set_device('cpp_standalone', directory='standalone')

    @implementation('cpp', '''
         double piecewise_linear(double I) {
            if (I < 1e-9)
                return 0;
            if (I > 3e-9)
                return 100;
            return (I/1e-9 - 1) * 50;
         }
         ''')
    @check_units(I=amp, result=Hz)
    def piecewise_linear(I):
        raise NotImplementedError('use standalone mode')
    ##
    input = PoissonGroup(10, rates=piecewise_linear(10*amp))
    run(1*second, report='text')
Marcel Stimberg
@mstimberg:matrix.org
[m]

Hi @wxie2013: the way you called piecewise_linear, it will be directly executed in Python instead of being integrated into the generated code. It needs to be in a string, i.e. use

input = PoissonGroup(10, rates='piecewise_linear(10*amp)')

Of course, it would make only really sense if the expression was a function of time or of some variable changing with time.

Marcel Stimberg
@mstimberg:matrix.org
[m]

:point_up: Edit: Hi wxie2013 (wxie2013): the way you called piecewise_linear, it will be directly executed in Python instead of being integrated into the generated code. It needs to be in a string, i.e. use

input = PoissonGroup(10, rates='piecewise_linear(10*amp)')

Of course, it would make only really sense if the expression was a function of time or of some variable changing with time.

1 reply
First6a
@First6a
Hi, I'm new to brian2 and plan to use it on an Apple MacBookPro 2021, arm-64 M1max running macOS 12.5 (Monterey). I downloaded brian2 v.2.3 (via conda miniforge3). Brian2 never passed the tests, exiting with False everytime, but seems to work almost fine but with strange non-repeatable errors. My guess is the dev did not yet reach the last updated macOS (12)
First6a
@First6a
... my questions then : 1. is there any version currently working on an M1max MBP / macOS 12, that I did not find in the doc ? 2. If not, is there any possibility to build a safe local version on my MBP, and then (modestly) contribute somehow to the brian project ? 3. In any case, is there any brian2 planned development for "apple silicon" and the latest versions of macOS, be it the actual, Monterey 12.5, and/or the next one (Ventura) announced this fall ? Thanks in advance for your answers. Regards. Marc.
wxie2013
@wxie2013

what's the difference between "when=end" and "when=before_end". I'm going through the example:

https://brian.discourse.group/t/changing-stimuli-programmatically-in-c-standalone/748

by changing the "when=before_end" to "when=end"
in "stimulus_control.run_regularly()", the results are quite different

Rihana Naderi
@RNaderi
I have some questions about the relationship between astrocyte numbers and neurons in Neuroscience. are there any references could I find more about that? q1) how many astrocytes can supervise synapses? q2)which synapses can be supervised by astrocytes? q3) is it dependent on the number of neurons around them, if so, what is the connection? Thanks in advance.