July 2018
Intermediate to advanced
254 pages
8h 12m
English
If we put all the method implementations together, we will get a code snippet that looks like this:
EPSILON_MIN = 0.005max_num_steps = MAX_NUM_EPISODES * STEPS_PER_EPISODEEPSILON_DECAY = 500 * EPSILON_MIN / max_num_stepsALPHA = 0.05 # Learning rateGAMMA = 0.98 # Discount factorNUM_DISCRETE_BINS = 30 # Number of bins to Discretize each observation dimclass Q_Learner(object): def __init__(self, env): self.obs_shape = env.observation_space.shape self.obs_high = env.observation_space.high self.obs_low = env.observation_space.low self.obs_bins = NUM_DISCRETE_BINS # Number of bins to Discretize each observation dim self.bin_width = (self.obs_high - self.obs_low) / self.obs_bins self.action_shape = env.action_space.n ...
Read now
Unlock full access