nengo / nengo-dl

Deep learning integration for Nengo
https://www.nengo.ai/nengo-dl
Other
88 stars 22 forks source link

More memory optimizations #129

Closed drasmuss closed 4 years ago

drasmuss commented 4 years ago

The main change here is avoiding storing simulator state for signals targeted by set operations (since that state will never be read).

I also added some more graph simplification functions. One (remove_constant_copies), I had previously disabled because it could change which signals are stored by save_params/load_params. But thinking about this more, that doesn't seem worth disabling it for. As long as the user is consistently using (or not using) remove_constant_copies in both networks, then save/load params will work fine. So better to have it enabled by default (users can still disable it if they run into problems).

The second one remove_reset_incs, I had previously completely removed because in general it seemed to make things worse. But I realized that this was largely to do with the kinds of networks we often build in Nengo, which have a lot of horizontal parallelism. In more deep learning style networks, where you just have a big long chain of objects, remove_reset_incs can still be helpful. And then with some further testing, I didn't really see any significant performance decreases when enabling it by default, so I just went with that.