GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SciSharp/Gym.NET: openai/gym's popular toolkit for developing and comparing reinforcement learning algorithms port to C#.

BranchesTags
Open more actions menu

Latest commit

 

History

127 Commits
127 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
examples/ReinforcementLearning
examples/ReinforcementLearning
 
 
refs
refs
 
 
src
src
 
 
tests/Gym.Tests
tests/Gym.Tests
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
GEMINI.md
GEMINI.md
 
 
Gym.NET.sln
Gym.NET.sln
 
 
Gym.NET.sln.DotSettings
Gym.NET.sln.DotSettings
 
 
LICENSE
LICENSE
 
 
PRD.md
PRD.md
 
 
README.md
README.md
 
 
ROADMAP.md
ROADMAP.md
 
 

Repository files navigation

Gym.NET

NuGet

A port of openai/gym to C#.

openai/gym

OpenAI Gym is a toolkit for developing and comparing reinforcement learning algorithms. This is the gym open-source library, which gives you access to a standardized set of environments.

Installation

### For gym's abstract classes for RL, install:
PM> Install-Package Gym.NET

### For implemented environments, install:
PM> Install-Package Gym.NET.Environments
PM> Install-Package Gym.NET.Rendering.Avalonia
PM> Install-Package Gym.NET.Rendering.WinForm

Example

The following example runs and renders cartpole-v1 environment.

using NumSharp;
using SixLabors.ImageSharp;
using Gym.Environments;
using Gym.Environments.Envs.Classic;
using Gym.Rendering.WinForm;

CartPoleEnv cp = new CartPoleEnv(WinFormEnvViewer.Factory); //or AvaloniaEnvViewer.Factory
bool done = true;
for (int i = 0; i < 100_000; i++)
{
    if (done)
    {
        NDArray observation = cp.Reset();
        done = false;
    }
    else
    {
        var (observation, reward, _done, information) = cp.Step((i % 2)); //we switch between moving left and right
        done = _done;
        //do something with the reward and observation.
    }

    SixLabors.ImageSharp.Image img = cp.Render(); //returns the image that was rendered.
    Thread.Sleep(15); //this is to prevent it from finishing instantly !
}

cp.Close();

Roadmap

  • Implement Spaces

    • Space (base class)
    • Box
    • Discrete
    • multi.*.py
  • Implement Env base classes

    • Env(object)
    • GoalEnv(Env)
  • Implement environments
    To run an environment, see Gym.Tests

    • Convert Gym.Environments to a net-standard project.
    • classics
      • CartPole-v1
        • Compare visually against python's version
      • walker2d_v3
      • acrobot
      • continuous_mountain_car
      • mountain_car
      • pendulum
      • rendering
    • Mujco
      • ant_v3
      • half_cheetah_v3
      • hopper_v3
      • humanoid_v3
      • humanoidstandup
      • inverted_double_pendulum
      • inverted_pendulum
      • mujoco_env
      • pusher
      • reacher
      • striker
      • swimmer_v3
      • thrower
    • box2d
      • bipedal_walker
      • car_dynamics
      • car_racing
      • lunar_lander
    • atari

About

openai/gym's popular toolkit for developing and comparing reinforcement learning algorithms port to C#.

Topics

gymmachine-learningopenaireinforcement-learningscisharp

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

140 stars

Watchers

14 watching

Forks

20 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.