Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_replay_memory_atari_throughput(self):
"""
Tests throughput on standard Atari envs using the replay memory.
"""
agent = DQNAgent(
states_spec=self.env.state_space,
action_spec=self.env.action_space,
network_spec=self.network,
memory_spec=dict(
type='replay_memory',
capacity=100000,
next_states=True
)
)
worker = SingleThreadedWorker(
environment=self.env,
agent=agent,
repeat_actions=1
)
result = worker.execute_timesteps(num_timesteps=1000000, deterministic=False)
def test_prioritized_replay_atari_throughput(self):
"""
Tests throughput on standard Atari envs using the prioritized replay memory.
"""
agent = DQNAgent(
states_spec=self.env.state_space,
action_spec=self.env.action_space,
network_spec=self.network,
memory_spec=dict(
type='prioritized',
capacity=100000,
next_states=True
)
)
worker = SingleThreadedWorker(
environment=self.env,
agent=agent,
repeat_actions=1
)
result = worker.execute_timesteps(num_timesteps=1000000, deterministic=False)