DQN
Deep Q-Learning
Q-learning (Watkins, 1989, Mnih et. al, 2013) algorithms estimate the optimal Q function, i.e the value of taking action A in state S under the optimal policy. Q-learning algorithms have an implicit policy (strategy for acting in the environment). This is typically -greedy, in which the action with the maximum Q value is selected with probability and a random action is taken with probability , or boltzmann (see definition below). Random actions encourage exploration of the state space and help prevent algorithms from getting stuck in local minima.
Q-learning algorithms are off-policy algorithms because the target value used to train the network is independent of the policy used to generate the training data. This makes it possible to use experience replay to train an agent.
It is bootstrapped algorithm; updates to the Q function are based on existing estimates, and a temporal difference algorithm; the estimate in time t
is updated using an estimate from time t+1
. This allows Q-Learning algorithms to be online and incremental, so the agent can be trained during an episode.
Algorithm: DQN with target network
See dqn.json for example specs of variations of the DQN algorithm (e.g. DQN, DoubleDQN, DRQN). Parameters are explained below.
Basic Parameters
algorithm
name
general paramaction_pdtype
general paramaction_policy
string specifying which policy to use to act. "boltzmann" or "epsilon_greedy"."boltzmann" policy selects actions by sampling from a probability distribution over the actions. This is generated by taking a softmax over all the Q-values (estimated by a neural network) for a state, adjusted by the temperature parameter, tau.
"epsilon_greedy" policy selects a random action with probability epsilon, and the action corresponding to the maximum Q-value with (1 - epsilon).
explore_var_start
initial value for the exploration parameters (tau or epsilon)explore_var_end
end value for the exploration parameters (tau or epsilon)explore_anneal_epi
how many episodes to take to reduce the exploration parameter value from start to end. Reduction is currently linear.gamma
general paramtraining_batch_epoch
how many gradient updates to make per batch.training_epoch
how many batches to sample from the replay memory each time the agent is trainedtraining_frequency
how often to train the algorithm. Value of 3 means train every 3 steps the agent takes in the environment.
memory
name
general param. Compatible types; "Replay", "PrioritizedReplay"batch_size
how many examples to include in each batch when sampling from the replay memory.max_size
maximum size of the memory. Once the memory has reached maximum capacity, the oldest examples are deleted to make space for new examples.
net
type
general param. Compatible types; all networkshid_layers
general paramhid_layers_activation
general paramoptim_spec
general param
Advanced parameters
algorithm
training_min_timestep
how many time steps to wait before starting to train. It can be useful to set this to 0.5 - 1x the batch size so that theDQN
has a few examples to learn from in the first training iterations.action_policy_update
how to update theexplore_var
parameter in the action policy each episode. Available options are "linear_decay", "rate_decay", and "periodic_decay". See policy_util.py for more details.
memory
use_cer
: whether to used Combined Experience Replay
net
rnn_hidden_size
general paramrnn_num_layers
general paramseq_len
general paramupdate_type
method of updatingtarget_net
. "replace" or "polyak". "replace" replacestarget_net
withnet
everyupdate_frequency
time steps. "polyak" updatestarget_net
withpolyak_weight
target_net
+ (1 -polyak_weight
)net
each time step.update_frequency
how often to updatetarget_net
withnet
when using "replace"update_type
.polyak_weight
how much weight to give the oldtarget_net
when updating thetarget_net
using "polyak"update_type
clip_grad
: general paramclip_grad_val
: general paramloss_spec
: general paramlr_decay
: general paramlr_decay_frequency
: general paramlr_decay_min_timestep
: general paramlr_anneal_timestep
: general paramgpu
: general param
Last updated