axon

command
v2.0.0-dev0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

README

axon

This example tests the axon CycleNeuron function that implements a full conductance-based biologically realistic and detailed model of how a cortical pyramidal neuron responds to excitatory and inhibitory inputs. In addition to basic excitation, inhibition, and leak channels, there are a number of active gated channels such as NMDA, GABA-B, M-type mAHP, etc channels that are a function of membrane potential (Vm) and other factors such as calcium (Ca) and sodium (Na).

The equations are much more complex compared to typical GPU-based matrix algebra (e.g., a dot product), and the parameter data structures include many 10's of float32 values, providing a good test of Go -> HLSL parsing and alignment checking, so that the resulting struct values can be directly copied from CPU to GPU.

The actual computation is relatively simple: an array of Neuron structures is allocated, initialized, and copied from CPU to GPU. Then the overall CycleNeuron method is called repeatedly, for 200 cycles, which is the typical number of iterations per functional trial in axon.

A comparison of the CPU and GPU results are printed, along with timing.

All of the neurons receive the same excitatory input, and thus have the same behavior.

Building

There is a //go:generate comment directive in main.go that calls gosl on the relevant files, so you can do go generate followed by go build to run it. There is also a Makefile with the same gosl command, so make can be used instead of go generate.

The generated files go into the shaders/ subdirectory.

The generate step must be re-run if any of the computation-relevant code is changed (i.e., within the //gsl: start / end blocks) but e.g., changing the number of neurons in main.go does not require a re-generate.

TODO:

The time update is not working on linux -- only on mac -- probably something about shared memory.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package chans provides standard neural conductance channels for computing a point-neuron approximation based on the standard equivalent RC circuit model of a neuron (i.e., basic Ohms law equations).
Package chans provides standard neural conductance channels for computing a point-neuron approximation based on the standard equivalent RC circuit model of a neuron (i.e., basic Ohms law equations).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL