2013/uns13/resources: nengo_communication_channel.py

File nengo_communication_channel.py, 0.8 KB (added by francesco.galluppi, 5 years ago)

Nengo/SpiNNaker communication channel example

Line 
1"""
2communication channel example for nengo/spinnaker
3
4A->B implementing the identity function f(x)=x
5
6Results can be viewed using the following command:
7./nengo-cl nengo_spinnaker_interface/viewer_1d.py -b <spinnaker board address> -d 1 -s 2
8"""
9import nef                     
10
11# importing the Nengo/SpiNNakerinterface module
12import nengo_spinnaker_interface.spinn as spinn
13
14net=nef.Network('communication_channel_spinnaker',quick=True)
15               
16input=net.make_input('input',[0])
17
18A=net.make('A', neurons=128, dimensions=1, max_rate=(100,150),radius=1, intercept=(-.9,.9))
19B=net.make('B', neurons=128, dimensions=1, max_rate=(100,150),radius=1, intercept=(-.9,.9))
20
21net.connect(input,A)
22net.connect(A,B)
23
24s=spinn.SpiNN(net.network)
25s.print_info()
26#s.set_runtime(5*60*1000)
27s.write_to_file('nengo_spinnaker_interface/nengo_values.py')
28
29