A Unity project demonstrating GPU-accelerated spiking neural network shaders.
- All SNNs are standard HLSL shader implementations of their respective models.
- Each shader computes the model across 3 color channels
R,G,Bsimulating each color channel as an independent instance of the model
- Each shader computes the model across 3 color channels
- Each model's simulation has the following:
- CustomRenderTexture-based shaders implementing the equations for each of the state variables the model
- A material referencing each shader, which instantiates the shader
- A CustomRenderTexture referencing each material allowing the values to be updated via script
- A Simulation script that manages references to the materials and CustomRenderTextures and makes sure all state variables are updated synchronously
- A NetworkClock that manages simulation speed
- Each model is implemented in a separate scene with an input image
$I$ and the output voltage$V$ visualized - All simulations are integrated using Explicit Euler with a timestep proportional to the simulation speed
- Note that this can lead to instability in the Hodgkin Huxley model especially, but in all others at low framerates as well
- All shaders require the use of clamping for stability. This means that infinities are not possible, but that the model may misbehave at unreasonable values (very fun to play with).
- Some simulations are easier to look at when some noise is applied to the input signal. For the Izhikevich model, uniform noise was added to make the images easier to look at.
For all scenes:
-
$I$ is computed as a scaled input from the input image - A slider is available to manipulate simulation speed
- WARNING: Certain simulation configurations can lead to very fast flashing images.
if
Sliders and Color Pickers to manipulate
if
then
Sliders and Color Pickers to manipulate
Membrane equation:
Total ionic current:
Sodium, potassium, and leak currents:
Gating variable dynamics:
Rate functions:
Sliders and Color Pickers to manipulate
-
$g_{Na}$ ,$E_{Na}$ -
$g_K$ ,$E_K$ -
$g_L$ ,$E_L$ $C$