1
$\begingroup$

I have done creating the virtual environment, creating the Q-table, initializing the q-parameters, then I made a training module and stored it in a numpy array. After completion of training, I have updated the q-table and now I get the plots for the explorations But how can I code for rate decay? Here is my sample code for every step of the training module,

for step in range(max_steps): 
        exploration_rate_threshold = random.uniform(0,1)

        if exploration_rate_threshold > exploration_rate:
            action = np.argmax(q_table[state,:])
        else:
            action = env.action_space.sample()
$\endgroup$

1 Answer 1

1
$\begingroup$

Here is one way to calculate the exploration rate decay:

exploration_rate = min_exploration_rate + \ (max_exploration_rate - min_exploration_rate) * np.exp(-exploration_decay_rate*episode)
$\endgroup$
2
  • $\begingroup$ why is exploration_decay_rate negative in np.exp()? $\endgroup$
    – mogoja
    Commented Jul 29, 2020 at 17:10
  • $\begingroup$ on finish of every step of training, exploration rate decreases or decays at a rate proportional to its ongoing decay value. Hence, its negative for every episode. $\endgroup$ Commented Jul 29, 2020 at 17:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .