ctn-archive / nengo_theano

ABANDONED; see https://github.com/nengo/nengo instead
MIT License
3 stars 3 forks source link

Be compatible with Nengo examples #24

Open tbekolay opened 11 years ago

tbekolay commented 11 years ago

I've just copied the demos directory of Nengo to examples (which is a more standard naming) in the nef-py directory. We should see which of these can currently be run with the theano version. Check them off if you can confirm they work, and try to do some benchmarking with it (i.e., run it for x seconds, see how long each version takes)

studywolf commented 11 years ago

So I'm looking at these now; and, for example, in twoneurons.py there's a net.add_to_nengo() command. This is clearly not a command that we want in the theano code, and nef_theano is being imported as nef, so does it sound good to just remove this and replace with net.run(time) instead?

I would suggest doing this and then worrying about getting the exact same code running in both after we nail down the API we want at the code sprint...

Or we could have a check to see if we're in Nengo or theano code and then either do net.run or net.network.simulator.run(start, end, dt)...

tbekolay commented 11 years ago

Yeah, of course. I mean, you can do it locally, like you said, when we discuss the NEF API these will have to be changed anyhow, but for the purposes of just seeing what works and what doesn't, this issue is mainly just to see what things should work but don't. add_to_nengo obviously shouldn't.

tcstewar commented 11 years ago

net.run() should work in both Nengo and Theano -- that's a part of the API that I think we're happy with.

Interestingly, net.add_to_nengo() currently does nothing at all in the nengo-cl version. I could see an argument that if we changed it to net.add_to_ui() it could be a standard part of the API which does nothing if there's no gui, but if there is one (for Nengo or some hypothetical future HTML5 tablet UI), it would work.

studywolf commented 11 years ago

yup, I've just been removing the add to nengo command and replacing with net.run. And xuan is working on the benchmarking stuff to have things run between both so we can wait on that to do formal runtime / buildtime testing.

studywolf commented 11 years ago

So I've checked out these now, and the ones dependent on nps or other files out in the Nengo folder aren't running, and there's a learning class that I think we're just replacing with net.learn, right? Aside from that they all worked, matrix_multiplication picked up a bug in the make_encoders function for when a set of encoders are specified. I would think the next thing to do would be to port over the basal ganglia code (especially since I need it for my own code), and then check out the basalganglia test again.

studywolf commented 11 years ago

Oh and also there are several that don't run because they use Input with that format net.make_input('input',{0.2:5, 0.3:0, 0.44:-10, 0.54:0, 0.8:5, 0.9:0} that hasn't been implemented yet.

tbekolay commented 11 years ago

Yeah -- we'll talk about net.learn at the sprint, I don't think the current API is a very good way to do it, so we should brainstorm better ideas then.

studywolf commented 11 years ago

OK, I'm going to reimplement them by making an error population and calling net.learn for now.

tbekolay commented 11 years ago

Sounds good.

studywolf commented 11 years ago

OK, I think those are all the ones that I'm going to get working, the rest I believe will require more infrastructure to be built first, and the SPA ones I'm not going to touch.