https://github.com/morvanzhou/rlarm
https://github.com/morvanzhou/rlarm
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/morvanzhou/rlarm
- Owner: MorvanZhou
- Created: 2020-12-02T04:36:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-12T08:39:31.000Z (over 5 years ago)
- Last Synced: 2025-04-10T14:27:34.891Z (about 1 year ago)
- Language: Python
- Size: 48.8 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robot Arm Environment for Reinforcement Learning
Multi arms setup for training an Reinforcement Learning algorithm.


## Install
```shell script
git clone https://github.com/MorvanZhou/RLarm
cd RLarm
pip3 install -r requirments.txt
```
## Training
state: distance to goal for each join, angle to goal for each join, if touches goal
All distances to goal are normalized to a range of \[0, 1].
All angles to goal are normalized to a range of \[-1, 1].
1 (touches) / -1 (not touches) is the last state.
State example:
`array([ 0.04573185, 0.13328803, -0.03580408, 0.47065321, -1. ])`
Train command:
```shell script
# train with 3 arms
python3 main.py -n 3
# train with 2 arms and hide window
python3 main.py -n 2 --hide
```
-n: number of arms
## Testing
After training, run following command to test the last stored model.
```shell script
# load 3 arms on 340 epoch
python3 main.py -n 3 --load 340
```