brainevent

Implements event-driven spike communication and plasticity operators for BrainX spiking neural networks.

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/chaobrain/BrainX-skill --skill brainevent-chaobrain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: brainevent
Source: https://github.com/chaobrain/BrainX-skill/tree/main/brainx-display-cases/creative-experiment-verification/06-seizure-recruitment/run2/.agents/skills/brainevent
Command: npx skills add https://github.com/chaobrain/BrainX-skill --skill brainevent-chaobrain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires brainevent, jax, brainstate, brainunit, numba, warp-lang, brainpy, braintools, and includes references (resource) components.

What problem does it solve? Building spiking neural networks requires efficient handling of binary spike events and sparse synaptic connectivity, which dense matrix operations waste memory and compute on. This Skill guides an AI agent to translate neural projections, binary firing events, and activity-dependent weight changes into BrainEvent's event-driven operators. ## Core Features & Use Cases - Binary Event Representation: Wrap boolean or 0/1 spike data in BinaryArray so multiplication visits only active presynaptic rows. - Connectivity Selection: Choose among dense arrays, explicit CSR/CSC sparse formats, JITC generated random connectivity, and fixed-degree fan-in/fan-out structures. - Event-Driven Plasticity: Apply pre- or postsynaptic spike-triggered weight updates to CSR or dense weights while preserving topology. - Custom Operators: Route custom CPU (Numba, C++) and GPU (Numba CUDA, Warp, raw CUDA) kernels through JAX-compatible custom calls. - Use Case: Construct a 100,000-neuron E/I network where JITCScalarR regenerates sparse connectivity from a seed, spikes propagate via spikes @ connectivity, and STDP updates stored CSR weights inside a compiled BrainState loop. ## Quick Start Ask the agent to build a spiking network layer using BrainEvent BinaryArray spikes multiplied by CSR connectivity and verify the postsynaptic input shape.

Frequently Asked Questions about brainevent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I multiply binary spikes with sparse connectivity in JAX?

Wrap the spike vector in brainevent.BinaryArray and use the @ operator with a CSR, CSC, JITC, or fixed-degree connectivity object. BrainEvent visits only active presynaptic rows and accumulates their weighted contributions into postsynaptic input.

Which sparse connectivity format should I use for spiking networks?

Use CSR or CSC for explicit stored edges, JITC classes for large random connectivity regenerated from a seed, and FixedNumPerPre or FixedNumPerPost for constant fan-out or fan-in. Dense arrays suit small or mostly-nonzero matrices.

Does BrainEvent support synaptic plasticity like STDP?

Yes, BrainEvent provides update_csr_on_binary_pre, update_csr_on_binary_post, and dense equivalents that modify stored weights based on spike triggers and traces. Topology stays fixed; only weight values change, and updates run inside BrainState transforms.

Can I write custom GPU kernels for BrainEvent operations?

Yes, BrainEvent supports Numba CUDA, Warp, and raw CUDA kernels registered through XLACustomKernel or loaded via load_cuda_inline. Kernels must launch on the XLA-managed stream and be validated against a JAX reference implementation.

When should I not use JITC connectivity?

Avoid JITC when individual edges must be inspected, mutated, or learned, since JITC regenerates connections from a seed rather than storing them. Use stored CSR or dense weights for plasticity or edge-level access.