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'})
def main(): agents = [ atari.a2c(), atari.c51(), atari.dqn(), atari.ddqn(), atari.ppo(), atari.rainbow(), ] envs = [ AtariEnvironment(env, device='cuda') for env in ['BeamRider', 'Breakout', 'Pong', 'Qbert', 'SpaceInvaders'] ] SlurmExperiment(agents, envs, 10e6, sbatch_args={'partition': '1080ti-long'})
def test_a2c_cuda(self): validate_agent(a2c(device=CUDA), AtariEnvironment("Breakout", device=CUDA))
def test_a2c(self): validate_agent(a2c(device=CPU), AtariEnvironment("Breakout", device=CPU))
''' Run the rull atari suite on swarm with a2c. You should modify this script to suit your needs. ''' from gym import envs from all.experiments import SlurmExperiment from all.presets.atari import a2c from all.environments import GymEnvironment # Use the first available GPU device = 'cuda' # Get all atari envs. # Note that this actually returns some games that aren't compatible. # Those slurm tasks will simply fail. envs = [ GymEnvironment(env, device) for env in envs.registry.env_specs.keys() if 'NoFrameskip-v4' in env and not '-ram' in env ] SlurmExperiment( a2c(device=device), envs, 1e9, sbatch_args={ 'partition': '1080ti-long' # long queue: run for a week })
''' Quick demo of a2c running on slurm. Note that it only runs for 1 million frames. For real experiments, you will surely need a modified version of this script. ''' from gym import envs from all.experiments import SlurmExperiment from all.presets.atari import a2c from all.environments import AtariEnvironment device = 'cuda' envs = [ AtariEnvironment(env, device) for env in ['Pong', 'Breakout', 'SpaceInvaders'] ] SlurmExperiment(a2c(device=device), envs, 1e6, sbatch_args={'partition': '1080ti-short'})
''' Quick demo 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 gym import envs from all.experiments import SlurmExperiment from all.presets.atari import a2c from all.environments import AtariEnvironment device = 'cuda' envs = [AtariEnvironment(env, device) for env in ['Pong', 'Breakout', 'SpaceInvaders']] SlurmExperiment(a2c(device=device), envs, 1e6, sbatch_args={ 'partition': '1080ti-short' })