-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated README. Finished testing with a clone
- Loading branch information
Showing
3 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
# Discriminator-Actor-Critic | ||
Note that all commands must be run from with the `dac` folder. | ||
## Setup | ||
1. Setup a Python 2 environment. (Commands for virtualenv given below) | ||
|
||
1. Setup virtualenv (WITH Python2 - you can use the command *which python2* to find the PYTHON2 PATH) | ||
``` | ||
pip install virtualenv | ||
virtualenv . -p {PYTHON2 PATH} | ||
source bin/activate | ||
virtualenv . -p $PYTHON2_PATH | ||
source bin/activate | ||
``` | ||
Note: You can use the command `which python2` to find the PYTHON2_PATH. | ||
|
||
2. Installation (NOTE: need mujoco 1.31 setup -> download the zip from https://www.roboti.us/ and put the unzipped mjpro131 folder in the ~/.mujoco folder used for the mujoco license for gym-v1): | ||
|
||
``` | ||
pip install -r requirements.txt | ||
cd dac | ||
pip install -e . | ||
``` | ||
|
||
3. Generate Trajectory Information (for Hopper, walker, ant, half-cheetah): | ||
We'll use the original GAIL implementation to generate trajectories. | ||
## Generate expert trajectories | ||
DAC requires the expert trajectories to already exist. We use the OpenAI imitation repo to generate trajectories. (This is the original GAIL repo). | ||
|
||
``` | ||
git clone https://github.com/openai/imitation | ||
cd imitation | ||
python -m scripts/im_pipeline pipelines/im_pipeline.yaml 0_sampletrajs | ||
cp imitation_runs/modern_stochastic/trajs/* ../DAC/trajs | ||
``` | ||
4. Run DAC | ||
cp imitation_runs/modern_stochastic/trajs/* ../trajs | ||
## Run DAC | ||
|
||
python dac.py --env_id=$environment_name --expert_path=$path/to/expert/traj | ||
Example (Ant-v1): | ||
|
||
python dac.py --env_id=Ant-v1 --expert_path=trajs/trajs_ant.h5 | ||
|
||
|
||
The environment name can be `Hopper-v1`, `HalfCheetah-v1`, `Ant-v1`, or `Walker2d-v1` | ||
|
||
The path to the expert trajectory should be a path to the correspond file in the `trajs` folder. | ||
|
||
``` | ||
python dac.py | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.