Skip to main content

ADSEQ: Autodifferentiable spike-event queues for brain simulation on AI accelerators

Project description

ADSEQ: Autodifferentiable spike-event queues for brain simulation on AI accelerators

ADSEQ aims to implement delay-enabled differentiable event queues for brain simulations

RSNN example

Q = adseq.implementations.FIFORing.sized(3)
syn = adseq.synapse.mk_synapses(Q,
      delay_ms=delays, dt_ms=dt,
      vthres=vthres, tau_syn_ms=tau_syn, n=n*n,
      max_delay_ms=7
      )
syn_step = jax.jit(type(syn).timestep_spike_detect_pre)
v = jnp.zeros(n)
state = v, syn
def step(state, t):
    v, syn = state
    isyn = weight @ syn.isyn.reshape((n,n)).sum(0)
    vnext, s = lif_step(v, isyn, tau_mem, dt, vthres)
    syn = syn.timestep_spike_detect_pre(
                   ts=t,
                   v=jnp.repeat(v, n),
                   vnext=jnp.repeat(vnext, n))
    state = vnext, syn
    return state, (v, s)
_, trace = jax.lax.scan(step, state, xs=ts = jnp.arange(10000)*dt)

Jaxley example

Support is a bit experimental. Note that performance will be suboptimal, and limited to singlespike implemetations, until Jaxley PR646 is merged

import jaxley as jx
import adseq.bridges.jaxley_bridge as adseq

# [...]

net = jx.Network([cell, cell])
jx.connect(net.cell(0).branch(0).loc(0.0),
           net.cell(1).branch(0).loc(0.0),
           adseq.DelaySynapse(vthres=10.0))
net.set('DelaySynapse_delay', 10.0)
net.set('DelaySynapse_weight', 0.05)
net.make_trainable('DelaySynapse_delay')

# [...]

parameters = net.get_parameters()
transform = jx.ParamTransform([
    {'DelaySynapse_delay':  jx.optimize.transforms.SigmoidTransform(.1, 50.0)},
])
def loss(opt_params):
    s = jx.integrate(net, delta_t=dt, params=transform.forward(opt_params))
    t = jnp.linspace(0, 1, s.shape[1])
    conv = jnp.exp(-10*(t - 0.7)**2) # move spike towards 70% of simulation time
    return - (s[1] * conv).mean()
for i in range(100):
    l, gradient = loss(opt_params), jax.jacfwd(loss)(opt_params)
    updates, opt_state = optimizer.update(gradient, opt_state)
    opt_params = optax.apply_updates(opt_params, updates)

Citation

@article{landsmeer2025eventqueues,
  title={EventQueues: Autodifferentiable spike event queues for brain simulation on AI accelerators},
  author={Landsmeer, Lennart PL and Movahedin, Amirreza and Hamdioui, Said and Strydis, Christos},
  journal={arXiv preprint arXiv:2512.05906},
  year={2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adseq-0.9.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adseq-0.9.2-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file adseq-0.9.2.tar.gz.

File metadata

  • Download URL: adseq-0.9.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adseq-0.9.2.tar.gz
Algorithm Hash digest
SHA256 3861d29052360a212cf50e578d8e14b65c4d58fd3c5c3becd66b8b04e8510753
MD5 4f94c9105c0d992452350c0d863d7cba
BLAKE2b-256 25351c3f714c7faaf51aee63a0816a15335f6caa6f0c1d77231d197247237bab

See more details on using hashes here.

Provenance

The following attestation bundles were made for adseq-0.9.2.tar.gz:

Publisher: python-publish.yml on llandsmeer/ml_spike_event_queues

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adseq-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: adseq-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adseq-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd3bd67c443c0d7ef8a8458724acda95bd827df706af104a55efd47b75df0c85
MD5 bc4040f098fa2fe46e8e1f5aaf26bce1
BLAKE2b-256 3b1b531306834059935d98957ffc7a4361353854358c8d5474b277e87e4ef629

See more details on using hashes here.

Provenance

The following attestation bundles were made for adseq-0.9.2-py3-none-any.whl:

Publisher: python-publish.yml on llandsmeer/ml_spike_event_queues

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page