Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rllib] Added evaluation script to RLLib #1295

Merged
merged 12 commits into from
Dec 11, 2017
Prev Previous commit
Next Next commit
Added tests for eval script
  • Loading branch information
pschafhalter committed Dec 8, 2017
commit ec16345241cd085bc37fd1cab38aacad7d132089
41 changes: 41 additions & 0 deletions test/jenkins_tests/multi_node_tests/test_rllib_eval.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

GYM_ENV='CartPole-v0'

# TODO: Test AC3

# Test for DQN
ALG='DQN'
EXPERIMENT_NAME=$GYM_ENV'_'$ALG
python ~/workspace/ray/python/ray/rllib/train.py --run $ALG --env $GYM_ENV \
--stop '{"training_iteration": 2}' --experiment-name $EXPERIMENT_NAME \
--checkpoint-freq 1

EXPERIMENT_PATH='/tmp/ray/'$EXPERIMENT_NAME
CHECKPOINT_FOLDER=$(ls $EXPERIMENT_PATH)
CHECKPOINT=$EXPERIMENT_PATH'/'$CHECKPOINT_FOLDER'/checkpoint-0'

python ~/workspace/ray/python/ray/rllib/eval.py $CHECKPOINT --run $ALG \
--env $GYM_ENV --hide

# Clean up
rm -rf $EXPERIMENT_PATH

# Test for PPO
ALG='PPO'
EXPERIMENT_NAME=$GYM_ENV'_'$ALG
python ~/workspace/ray/python/ray/rllib/train.py --run $ALG --env $GYM_ENV \
--stop '{"training_iteration": 2}' --experiment-name $EXPERIMENT_NAME \
--checkpoint-freq 1

EXPERIMENT_PATH='/tmp/ray/'$EXPERIMENT_NAME
CHECKPOINT_FOLDER=$(ls $EXPERIMENT_PATH)
CHECKPOINT=$EXPERIMENT_PATH'/'$CHECKPOINT_FOLDER'/checkpoint-1'

echo $CHECKPOINT
python ~/workspace/ray/python/ray/rllib/eval.py $CHECKPOINT --run $ALG \
--env $GYM_ENV --hide

# Clean up
rm -rf $EXPERIMENT_PATH