
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
The code in this repository accompanies the Towards Data Science article Creating a Custom Gym Environment for Jupyter Notebooks - Part 1: Creating the framework and shows the steps required to create a custom gym environment with graphical output in a Jupyter notebook.
pip install babyrobot
An example notebook showing how animation and movie creation can be done in the Baby Robot Gym environment:
The example notebook, showing all of the API calls used to create a Baby Robot Gym environment can be opened here:
An example of using the PPO Reinforcement Learning algorithm to train Baby Robot how to escape from a maze:
The test notebook, showing how to run a simple RL environment can be opened here:
To get up and running with this simple custom Gym Environment, do the following:
git clone https://github.com/WhatIThinkAbout/BabyRobotGym.git
cd BabyRobotGym
To be able to run our environment we need to have a few other packages installed, most notably 'Gym' itself. To make it easy to setup the environment the Github repo contains a couple of '.yml' files that list the required packages.
To use these to create a Conda environment and install the packages, do the following (choose the one appropriate for your operating system):
On Unix:
conda env create -f environment_unix.yml
On Windows:
conda env create -f environment_windows.yml
We've created the environment with all our required packages, so now it's just a case of activating it, as follows:
conda activate BabyRobotGym
(when you're finished playing with this environment run "conda deactivate" to get back out)
And once the environment has been activated, to create a Jupyter kernel, run the following. This will let the environment be selected from within your Jupyter notebook:
python -m ipykernel install --user --name=BabyRobotGym
Everything should now be in place to run our custom Gym environment. To test this we can run the sample Jupyter Notebook 'baby_robot_gym_test.ipynb' that's included in the repository. This will load the 'BabyRobotEnv-v1' environment and test it using the Stable Baseline's environment checker.
To start this in a browser, just type:
jupyter notebook baby_robot_gym_test.ipynb
(When running in jupyter notebook the current Conda environment will automatically be used and the required packages should all be available. It's also possible to run "python -m ipykernel install --user --name=BabyRobotGym" which will create a Jupyter Notebook kernel, that can then be selected from the notebook's menu.)
Or else just open this file in VS Code and make sure 'BabyRobotGym' is selected as the kernel. This should make the 'BabyRobotEnv-v1' environment, test it in Stable Baselines and then run the environment until it completes, which happens to occur in a single step, since we haven't yet written the 'step' function!
If, while running in a terminal (as opposed to a Jupyter Notebook) you get the warning "DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs", in a terminal run:
export JUPYTER_PLATFORM_DIRS=1
followed by:
jupyter --paths
FAQs
An OpenAI Gym Environment for BabyRobot
We found that babyrobot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.