Advertisement
Guest User

Code gen

a guest
May 28th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import nef
  2. import math
  3.  
  4. net=nef.Network('Sine Wave')
  5.  
  6. # define the SimpleNode
  7. class SineWave(nef.SimpleNode):
  8. def __init__(self,name):
  9. nef.SimpleNode.__init__(self,name)
  10. self.anyparam = 4
  11. self.duration = 34
  12. def origin_wave(self):
  13. return [math.sin(self.t)]
  14. wave=net.add(SineWave('wave'))
  15. net.make('neurons',100,1)
  16.  
  17. # connect the SimpleNode to the group of neurons
  18. net.connect(wave.getOrigin('wave'),'neurons')
  19. net.add_to_nengo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement