js-gym
js-gym copied to clipboard
Reinforcement learning in JavaScript & Node.js
js-gym
JavaScript environment for training reinforcement learning agents.
Installation
To download the code and install the requirements, you can run the following shell commands:
$ git clone https://github.com/bobiblazeski/js-gym.git
$ cd js-gym
$ npm install
Getting started
This code is intended to be run locally by a single user. The server runs in node.js.
To start the server from the command line, run this:
$ node server/start.js
If you have pretrained weights you could pass them
$ node server/start.js --kano=t04051134 --subzero=t04051134
You can open your browser at http://localhost:3000/
Sample algorithms
- Random Play
- Random Search
- HillClimbing
- Augmented Random Search
- Deep Deterministic Policy Gradient
Environments
MK
Adaptation of https://github.com/mgechev/mk.js
Action space
Action is an object containing two keys, subzero & kano. Each key contains an array of 18 probabilities which represent possible actions for the users. The sum of all actions should be ~1.
The environment is stochastic, and uses weighted random choice to select a move for your agent. Unless you pass one hot action.
State space
47 floating numbers between 0 & 1
TetNet
Adaptation of https://github.com/IdreesInc/TetNet
Action space
Integer in the range of [0, 11).
State space
Javascript object containing information about the game.