3882ff98e3a8e2a4e16393e72f7107e191c06cf7,tensorforce/tests/test_dqn_agent.py,TestDQNAgent,test_dqn_agent,#TestDQNAgent#,30
Before Change
state = (1, 0)
rewards = [0.0] * 100
for n in xrange(10000):
action = agent.get_action(state=state)
if action == 0:
state = (1, 0)
reward = 0.0
terminal = False
else:
state = (0, 1)
reward = 1.0
terminal = False
agent.add_observation(state=state, action=action, reward=reward, terminal=terminal)
rewards[n % 100] = reward
if sum(rewards) == 100.0:
return
assert(sum(rewards) == 100.0)
After Change
network_builder = layered_network_builder([{"type": "dense", "num_outputs": 16}, {"type": "linear", "num_outputs": 2}])
agent = DQNAgent(config=config, network_builder=network_builder)
runner = Runner(agent=agent, environment=environment)
def episode_finished(r):
return r.episode < 100 or not all(x >= 1.0 for x in r.episode_rewards[-100:])
runner.run(episodes=10000, episode_finished=episode_finished)
self.assertTrue(runner.episode < 10000)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: reinforceio/tensorforce
Commit Name: 3882ff98e3a8e2a4e16393e72f7107e191c06cf7
Time: 2017-05-15
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/tests/test_dqn_agent.py
Class Name: TestDQNAgent
Method Name: test_dqn_agent
Project Name: reinforceio/tensorforce
Commit Name: 3882ff98e3a8e2a4e16393e72f7107e191c06cf7
Time: 2017-05-15
Author: mi.schaarschmidt@gmail.com
File Name: tensorforce/tests/test_dqfd_agent.py
Class Name: TestDQFDAgent
Method Name: test_dqfd_agent
Project Name: reinforceio/tensorforce
Commit Name: da7009655b63c5d96be0039af421ab56de379ef1
Time: 2020-07-18
Author: alexkuhnle@t-online.de
File Name: test/test_features.py
Class Name: TestFeatures
Method Name: test_pretrain