March 2018
Intermediate to advanced
272 pages
7h 53m
English
With a model, memory, and policy defined, we're now ready to create a deep Q network Agent and send that agent those objects. Keras RL provides an agent class called rl.agents.dqn.DQNAgent that we can use for this, as shown in the following code:
dqn = DQNAgent(model=model, nb_actions=num_actions, memory=memory, nb_steps_warmup=10, target_model_update=1e-2, policy=policy)dqn.compile(Adam(lr=1e-3), metrics=['mae'])
Two of these parameters are probably unfamiliar at this point, target_model_update and nb_steps_warmup: