Differences In Intrerfacing OpenAI Gym With Nengo and NEST

I tried to connect Nengo with OpenAI Gym and it was just a few lines of code but the same thing to be achieved with NEST needs the MUSIC interface and quite a lot of work.

Why is this so easy with Nengo but so difficult with other simulators?

We’re glad you think that Nengo is easy to use @Adam_Antios!

The short answer is that the use case that you’re describing (interfacing Nengo with a real-time Python environment) is one of the main use cases we had in mind when we developed Nengo 2.0. Those are the kind of models we wanted to develop, so we made sure that it would be easy to develop those kinds of models in Nengo 2.

The longer more technical answer is that we made a lot of architectural decisions to enable this use case:

  • We kept dependencies minimal (just NumPy) so that it’s easy to install and get started making models. Other similar projects have more complicated installs for various technical and historical reasons (e.g., NEST is a C++ project with Python bindings, so it must be complied).
  • We allow you to execute arbitrary Python code during the simulation through nengo.Node. Other similar projects are designed to run just the neural network component of a model, rather than the whole model. A whole model almost always includes non-neural inputs, and in many important cases includes outputs that are fed back into the neural network component of the model.
  • We use normal Python objects and idioms wherever possible to make interfacing with other Python libraries straightforward. Any custom object we add to our API adds to the user’s cognitive load, so whenever it was possible to use plain Python objects, we opted for that over a custom internal solution. Other similar projects are not as well integrated into the Python ecosystem, in part because they were not originally written in Python, or possibly because they do not use checkers and linters to ensure that Python idioms are used where possible.
1 Like

Thank you for the very detailed answer!