/NeuronLayerBox

Computational Neuroscience platform with cuda.

Primary LanguageCuda

NeuronLayerBox

Computational Neuroscience platform with cuda.
This platform is mainly for calculating stephen grossberg's model.
thalamocortical network

1.How to run:

In NeuronLayerBox file to recompile:

make clean
make
./NLB

open anthor terminal:python main.py,you will see this:
this picture show the fmri of layer5 in SMART model
input image
output layer5
Note:"./NLB" must be first.if there are some issues,you will clean the shared memory or restart your os.

2.how to use it:

you can refer main.py
your python file must live in NeuronLayerBOx1.0 file.

2.1 init

import numpy as np
import sys
sys.path.append("Interface/python/")
from init import NeuronLayerBox
NLB=NeuronLayerBox(step_ms=1,model=1,spike=0,restore=1)

model=1:like gym,u can control step time,model=0:real time,u can't control step time,but u can get the output anytime.
spike=0:output fmri data,spike=1:output spike data that indlude the last ten bits of data.
restore=1:restore last trained model,restore=0:train a new model without pertrained model.

2.2 process

input_src=[]
input_src.append(some input 2-D array) #the num of array must equal input num.In simple terms,len(input_src)=input_num
NLB.input(input_src)                   #input must be list
for i in range(50):
  NLB.step(5)                          #process 5ms if model=1.if model=0,this will return immediately.

2.3 save model

NLB.save()

it will save model in load_data/SaveData. NLB terminal will print information about model's name.

2.4 exit

NLB.exit()

this will delete shared memory and release NLB.