STDP MNIST with Brian2Cuda

Description of problem

Hello, I need to run the code of Diehl&Cook_spiking_MNIST_Brian2.py given in GitHub - zxzhijia/Brian2STDPMNIST: Brian 2 version of Paper "Unsupervised Learning of digit recognition using STDP" but with brian2cuda.
I installed brian2cuda and excuted it successfuly on the GPU
(using the script: from brian2 import *
import brian2cuda
set_device(“cuda_standalone”)
However, when I run the main code Diehl&Cook_spiking_MNIST_Brian2.py , I had some issues. Does anyone try to do that?
Thannk you

1 Like

Hi @Zeina The code you link to is written for Brian’s “runtime” mode, that mixes Python code and the actual simulation. To use “standalone” mode, you need to rewrite it a bit, to work around its limitations. See Computational methods and efficiency — Brian 2 2.7.1 documentation for a few hints. Brian2CUDA is one implementation of a “standalone” mode, so it won’t run with this code.

Note that @bjourne recently proposed a PR with another Brian2 implementation of this model (see Add Diehl and Cook (2015) small model by bjourne · Pull Request #1548 · brian-team/brian2 · GitHub) which will be merged into the documentation soon. I’ve been working on a standalone-compatible version of this code, which I also hope to publish before the end of the year.

2 Likes

Hi @mstimberg, thank you for your response.
The updated version of the code shown by @bjourne is interesting.
Looking forward for the standalone version of the code!