-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add command line scripts * add plot command line script * add examples folder * add watch and release scripts to setup.py * update getting started * update readme
- Loading branch information
Showing
15 changed files
with
127 additions
and
74 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
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
''' | ||
Quick example of usage of the run_experiment API. | ||
''' | ||
from all.experiments import run_experiment, plot_returns_100 | ||
from all.presets.classic_control import dqn, a2c | ||
from all.environments import GymEnvironment | ||
|
||
def main(): | ||
device = 'cpu' | ||
timesteps = 40000 | ||
run_experiment( | ||
[dqn(), a2c()], | ||
[GymEnvironment('CartPole-v0', device), GymEnvironment('Acrobot-v1', device)], | ||
timesteps, | ||
) | ||
plot_returns_100('runs', timesteps=timesteps) | ||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
''' | ||
Quick example of a2c running on slurm, a distributed cluster. | ||
Note that it only runs for 1 million frames. | ||
For real experiments, you will surely need a modified version of this script. | ||
''' | ||
from all.experiments import SlurmExperiment | ||
from all.presets.atari import a2c | ||
from all.environments import AtariEnvironment | ||
|
||
def main(): | ||
device = 'cuda' | ||
envs = [AtariEnvironment(env, device) for env in ['Pong', 'Breakout', 'SpaceInvaders']] | ||
SlurmExperiment(a2c(device=device), envs, 1e6, sbatch_args={ | ||
'partition': '1080ti-short' | ||
}) | ||
|
||
if __name__ == "__main__": | ||
main() |
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
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
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
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
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,39 +1,42 @@ | ||
'''Create slurm tasks to run benchmark suite''' | ||
import argparse | ||
'''Create slurm tasks to run release test suite''' | ||
from all.environments import AtariEnvironment, GymEnvironment | ||
from all.experiments import SlurmExperiment | ||
from all.presets import atari, classic_control, continuous | ||
|
||
# run on gpu | ||
device = 'cuda' | ||
def main(): | ||
# run on gpu | ||
device = 'cuda' | ||
|
||
def get_agents(preset): | ||
agents = [getattr(preset, agent_name) for agent_name in classic_control.__all__] | ||
return [agent(device=device) for agent in agents] | ||
def get_agents(preset): | ||
agents = [getattr(preset, agent_name) for agent_name in classic_control.__all__] | ||
return [agent(device=device) for agent in agents] | ||
|
||
SlurmExperiment( | ||
get_agents(atari), | ||
AtariEnvironment('Breakout', device=device), | ||
2e7, | ||
sbatch_args={ | ||
'partition': '1080ti-long' | ||
} | ||
) | ||
SlurmExperiment( | ||
get_agents(atari), | ||
AtariEnvironment('Breakout', device=device), | ||
2e7, | ||
sbatch_args={ | ||
'partition': '1080ti-long' | ||
} | ||
) | ||
|
||
SlurmExperiment( | ||
get_agents(classic_control), | ||
GymEnvironment('CartPole-v0', device=device), | ||
100000, | ||
sbatch_args={ | ||
'partition': '1080ti-short' | ||
} | ||
) | ||
SlurmExperiment( | ||
get_agents(classic_control), | ||
GymEnvironment('CartPole-v0', device=device), | ||
100000, | ||
sbatch_args={ | ||
'partition': '1080ti-short' | ||
} | ||
) | ||
|
||
SlurmExperiment( | ||
get_agents(continuous), | ||
GymEnvironment('LunarLanderContinuous-v2', device=device), | ||
500000, | ||
sbatch_args={ | ||
'partition': '1080ti-short' | ||
} | ||
) | ||
SlurmExperiment( | ||
get_agents(continuous), | ||
GymEnvironment('LunarLanderContinuous-v2', device=device), | ||
500000, | ||
sbatch_args={ | ||
'partition': '1080ti-short' | ||
} | ||
) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
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
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
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
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