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

LIF Channel #564

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

LIF Channel #564

wants to merge 4 commits into from

Conversation

jnsbck
Copy link
Contributor

@jnsbck jnsbck commented Jan 10, 2025

Added a simple LIF channel and also one that is potentially differentiable, although I have not tested this.

Probably needs some tests and scrutiny.

image

return {f"{self.name}_rem_tref": jnp.zeros_like(v)}


class SmoothLIF(Channel):
Copy link
Contributor

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):
Copy link
Contributor

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(
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe t_refractory?

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

Successfully merging this pull request may close these issues.

2 participants