This is a Julia implementation of the stochastic synapse model described in this paper.
See a short demo of the switching operation here.
This model has been superseded by Synaptogen.
import Pkg; Pkg.add(url="https://github.com/thennen/StochasticSynapses.jl")
using StochasticSynapses
M = 2^20
# Initialize a million cells
cells = [Cell() for m in 1:M]
# SET all cells to their low resistance state
applyVoltage!.(cells, -2f0)
# Apply random voltages to all cells
voltages = randn(Float32, M)
applyVoltage!.(cells, voltages)
I = Iread.(cells)
using StochasticSynapses, CUDA
M = 2^20
p = 10
cells = CellArrayGPU(M, p)
voltages = CUDA.randn(M)
applyVoltage!(cells, voltages)
I = Iread(cells)