rllib.js
Reinforcement learning library with JavaScript.
It provides some reinforcement learning algorithms and environments.
At this moment uses TensorFlow.js to implement functions and three.js for visualization.
Live example
Visual library: three.js
Motivation
JavaScript is a very popular programming language but JS developers have no instruments of RL.
This library was created to correct the situation.
Web game makers can use it to train game bots in 2D and 3D environments.
Other can find it useful to make experiments.
Unity developers can use ML methods with ml-agents
Install and start example
Starting example:
Linux, Windows
git clone https://github.com/polyzer/rllib.js.git
npm i
Hungry world 2D example using PPO algorithm in js
npm run ppo-hungry-js
Hungry world 2D example using PPO algorithm with Parcel
npm run ppo-hungry-jsm
Hungry world example using PPO algorithm with Parcel
npm run ppo-hungry3d-jsm
Hungry world example using PPO algorithm Node.js training
You can start Node.js example with:
npm run ppo_node
Algorithms:
Deep Q-learning:
- Base Deep Q-learning
- Dueling Q-learning
- Double Q-learning
Policy gradient:
- REINFORCE
- Actor-Critic
- PPO
- TRPO
Environments:
Without physics:
Flat world 3D.
Discrete and continuous versions.
- Agent have 10 eye-detectors.
- Target: Agent trying to learn eating only green items if he see them.
- Actions: turns on specified angles.
- Space: Agent recieves signal from each eye that specifies type of saw item.
Known issues:
Node.js
It could be helpful:
npm rebuild --build-from-source gl