For some parts of the neural network agents, the code was largely inspired by the code in: https://github.com/ageron/handson-ml