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

def init_params() method for channels #507

Open
michaeldeistler opened this issue Nov 15, 2024 · 1 comment
Open

def init_params() method for channels #507

michaeldeistler opened this issue Nov 15, 2024 · 1 comment

Comments

@michaeldeistler
Copy link
Contributor

michaeldeistler commented Nov 15, 2024

Problem

In many cases, one would want parameters to depend on one another. For example, if one has

channel_params = {"temperature": 37, "gNa": 0.1}

then the sodium conductance would depend on temperature via:

effective_gNa = 2.3 ** ((temperature - 37) / 10) * gNa

Proposed implementation

Together with @r-makarov and @kyralianaka, we think that the most elegant way of making this possible is to add a init_params() method to the Channel:

def init_params(self, states, v, params):
    effective_gNa = 2.3 ** ((params["temperature"] - 37) / 10) * params["gNa"]
    return {"gNa": effective_gNa}

Just like init_state(), init_params does not have to return all parameters, only the ones that are to be modified.

@jnsbck
Copy link
Contributor

jnsbck commented Nov 19, 2024

I like the idea! Also should allow module wide sharing of these params via make_trainable (if I am not mistaken). Might make sense to implement this in conjunction with #474.

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