Git Product home page Git Product logo

gym.net's Introduction

Gym.NET

NuGet

A complete port of openai/gym to C#.
** WORK IN PROGRESS **

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

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 !
}

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

gym.net's People

Contributors

nucs avatar dariooo512 avatar samuelcaldas avatar deepakkumar1984 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.