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

How to make Multiscale Adaptive Time constant neuron voltage between -65mV-10mV? #1

Open
russelljjarvis opened this issue Dec 3, 2020 · 3 comments

Comments

@russelljjarvis
Copy link

russelljjarvis commented Dec 3, 2020

Hi @dmeliza,
Thanks for writing the awesome MAT neuron model code. I am using the python versions of the code without the CPP core.
I have succeeded in applying a current injection to the neuron and measured the voltage response, however, I am finding that RMP is 0, and the spike peak is at about 10. I am having trouble figuring out which parts of the code to change to force the membrane potential to be in a more biological plausible range.

I am using numba jit to get model evaluation speeds close to C all while still in python.

I have a hunch that if I change some of the zeros in the impulse matrix to -np.sqrt(vr), they would multiply out to vr, but I still feel like that is the wrong way to do it.

My adaption of your code is here:
https://github.com/russelljjarvis/jit_hub/blob/main/mat.py#L97-L107

@rgerkin

@dmeliza
Copy link
Member

dmeliza commented Dec 5, 2020

The original Kobayashi et al (2009) paper isn't clear about this. Their model equations indeed have an RMP of 0, but several of their analyses suggest they introduced an offset so that they could use biologically realistic reversal potentials.

You should be able to fix the base model (equation 1) by replacing $-V$ with $(E_l - V)$. Off the top of my head, I am not sure how this translates to the impulse matrix for the exact integration, but it should be pretty easy to figure out.

Note that the spike threshold is a function of $\omega$, $\alpha_1$, and $\alpha_2$. I think you would need to offset $\omega$ to match your $E_l$ adjustment.

@russelljjarvis
Copy link
Author

russelljjarvis commented Dec 5, 2020

Awesome, thanks for these leads @dmeliza, I will try them out today.

@russelljjarvis
Copy link
Author

russelljjarvis commented Dec 6, 2020

I have to confess I actually couldn't figure it out, but I made a short term hack that gives me the desired effect:

I couldn't find any code that contains the term -V, but I understand that Y acts as V. There are a lot of places where you could alter the value of Y, I chose to defer manipulating Y until last.

I couldn't find a line of code that had all the terms:
$\omega$, $\alpha_1$, and $\alpha_2$. In python that would be: w,a_1,a_2.

But I did find this block which I believe to be a threshold function:

            h = y[2] + y[3] + y[4] + w
            if i > iref and y[0] > h:
                y[2] += a1
                y[3] += a2
                iref = i + int(tref * dt)
                spikes.append(i * dt)

https://github.com/russelljjarvis/jit_hub/blob/main/matnu.py#L262-L265

Here is a notebook of what some of this stuff looks like in practice. Thanks so much for responding to this issue.

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

No branches or pull requests

2 participants