Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import nef
- import math
- net=nef.Network('Sine Wave')
- # define the SimpleNode
- class SineWave(nef.SimpleNode):
- def __init__(self,name):
- nef.SimpleNode.__init__(self,name)
- self.anyparam = 4
- self.duration = 34
- def origin_wave(self):
- return [math.sin(self.t)]
- wave=net.add(SineWave('wave'))
- net.make('neurons',100,1)
- # connect the SimpleNode to the group of neurons
- net.connect(wave.getOrigin('wave'),'neurons')
- net.add_to_nengo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement