-
Notifications
You must be signed in to change notification settings - Fork 13
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
LIF Channel #564
base: main
Are you sure you want to change the base?
LIF Channel #564
Conversation
return {f"{self.name}_rem_tref": jnp.zeros_like(v)} | ||
|
||
|
||
class SmoothLIF(Channel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs
) | ||
return {f"{prefix}_rem_tref": new_rem_tref} | ||
|
||
def compute_current(self, states, v, params): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all currents and update_states should be written to handle a single compartment. This means that v
will be a scalar.
Use an select-case instead. Internally, we then vmap
the update_states
, and JAX
is smart enough to automatically case the cond
to where
.
# Decrease refractory time | ||
rem_tref = states[f"{prefix}_rem_tref"] | ||
# Reset refractory timer when spike occurs | ||
new_rem_tref = jnp.where( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no where
f"{self.name}_eLeak": -55, | ||
f"{self.name}_vth": -50, | ||
f"{self.name}_vreset": -55, | ||
f"{self.name}_Tref": 2.0, # refractory period in ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe t_refractory
?
Added a simple LIF channel and also one that is potentially differentiable, although I have not tested this.
Probably needs some tests and scrutiny.