Castles in the Sand

In my ongoing studies of Reinforcement Learning I keep running into the same problem (one of many, I must admit). Many authors/tutors use the OpenAI Gym framework to demonstrate the RL algorithms, because it’s so convenient to use (comes with many premade environments) and to customise. A consistent interface is always a good thing. Except that it isn’t. In the past I’ve had to fix some fairly trivial changes to the API, but the latest incarnation of API change is a bit more serious. The author I’m currently reading has created a custom environment that is a subclass of a gym class – that no longer exists. This is a bit more challenging to fix. Maybe the fix is simple, if you are thoroughly familiar with the gym API. So, should I spend time becoming familiar with the gym API in order to fix all the examples (upon which many chapters of books are based!) because they no longer work? I don’t expect to be using gym going forward, it’s just a ‘convenient’ teaching tool. It wouldn’t be such a problem if new teaching material came out often to keep up to date, but it doesn’t. I haven’t found a single book/course/article that doesn’t have this problem. I’m looking forward to Yves Hilpisch’s book coming out in December, but will it already be outdated by the time it is published? Somehow I don’t think he’ll be using OpenAI Gym for introductory examples/exercises, but I might be wrong. Or if he does it might have changed again by the time his book comes out.

ETA: I guess there is a simple fix, create a new Docker container with Tensorflow and an old version of gym. Not so simple though, as there has been a change to the maintainers of gym and I’m not sure if older versions are available for installation. Perhaps I should check that out.

Further ETA: I took the obvious solution and created a Docker container with old versions of everything! Had some compatibility issues but not too much. So now that code that was giving me errors doesn’t. Installing an old version of gym was not problem after all. Hopefully this setup will allow me to explore all those books, courses, etc that have given me problems lately.