-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gymnasium integration #78
base: main
Are you sure you want to change the base?
Conversation
2aa1b6c
to
698d4a4
Compare
Hi. Thanks for the PR. I was just taking a look to try and understand the various parts and dependencies. The python/python dependency is easy to provide/configure by simply installing the latest python for Windows, and clicking the option to add python to the PATH environment variable.
I think/hope I understood all of that correctly. To get Gymnasium I have tried
Full output
|
We'll need step by step instructions in a readme.md to help people get these dependencies in place, otherwise each person trying to use this will have to work through these dependencies and issues each time. |
Update: I followed the pip upgrade instructions, like so:
Running I downloaded swig 4.1.1 from https://sourceforge.net/projects/swig/, unzipped, and added swig.exe to the Windows PATH environment variable.
So I did |
Thank you for taking a look, @colgreen! In addition, I'm currently working on a distributed evaluation implementation that will allow us to evaluate computationally-intensive tasks across multiple machines. With a single SharpNeat server handling the genetic algorithm component, and multiple node-executors taking care of receiving, decoding, evaluating, and sending results back to the server, we'll be able to tackle even more complex challenges. I'm currently testing this setup with the Bipedal Walker Hardcore task on four 60-vCPU machines, fingers crossed for success! The tech stack includes I've also been working on improving the named pipes integration and have added support for the BSD socket Python component. This means we'll be able to evaluate our project on a wider variety of operating systems and reduce our reliance on Windows named pipes. I'm eager to share the results, iterations, and updates with you as soon as they're ready. |
Hello! I am excited to share my initial contribution towards integrating the Gymnasium (formerly OpenAI Gym) toolkit with SharpNeat. While the current solution is still in its early stages and requires further refinement, I believe it serves as a foundation for discussion and future development.
Integration overview:
GymnasiumEvaluator
,GymnasiumEvaluationScheme
, andGymnasiumExperimentFactory
. These classes aim to create a generic Gymnasium "bridging" task that accommodates the various environments available in the toolkit.GymnasiumControl
simply decoratesGenomeControl
and allows forOnGenomeUpdated
propagation. In future iterations, it would be beneficial to decouple the task UI from Windows/.NET (this also applies toGymnasiumExperimentUi
andGymnasiumExperimentUiFactory
).GymnasiumEpisode
is responsible for bridging, evaluating, and communicating with the Gymnasium environment. It uses named pipes for inter-process communication; however, alternatives for better cross-platform support and performance, such as memory-mapped files, should be considered. The script assumes the correct Python version is available in the system path, but future iterations could explore configurability and virtual environments. Communication involves two primary message types:action
andobservation+reward+termination
. Both continuous and discrete action spaces should be supported, although additional work is necessary.GymnasiumEpisode
also contains some stateless utility methods, which hopefully will be migrated to separate packages in the next iterations.GymnasiumEvaluationScheme
andGymnasiumEvaluator
are relatively straightforward, but they require additional parameterization to accommodate various inputs, outputs, rewards, and stopping conditions.main.py
is a Python script responsible for the counterpart of communication and Gymnasium environment control.I look forward to your feedback and suggestions! Thank you for your time.
First evolution attempts:
BipedalWalker-v3.mp4
ref
https://gymnasium.farama.org/
https://www.gymlibrary.dev/
https://gymnasium.farama.org/environments/box2d/bipedal_walker/