Episode count in reinforcement learning

Hi,



My query is regarding the reinforcement learning code



I want to understand how can I configure the code to run for a specific number of episodes?



As per the code provided, it runs till the time it reaches the end of data

Hi Mihir,



Just to avoid misunderstanding, may I ask what do you mean by episode?



 

Hi Suleyman,



By an episode, I mean the number of iterations for which the model will train

Hi Mihir,



In the code, as you may already know, the number of episodes is limited to 15. In section 17 - unit 1, run() function has the condition determining the number of episodes.



The if statement at the end of the function:



'if not episode % 15' sets the limit for 15. You can change this condition to run for a specific number of episodes.



Hope this helps.

 

Thanks for the explanation.



My understanding was a little different regarding episode.



In other reinforcement learning explanations that I have seen, episode is used as an iteration on the entire dataset, and not for each trade.



Why are we using an episode as a trade rather than iterating on entire dataset?

Hi Mihir,



While the definition is correct, there is a difference between the iteration on the dataset and one cycle through to the entire dataset. The latter one is known as 'epoch' (Epoch is also defined as the iteration over the entire dataset on Keras website). There are three different parameters you need to consider: batch size, episode/iteration, epoch. Epoch represents the one cycle over the entire dataset. To complete this cycle, a certain number of iterations is needed based on batch size. For example, if the batch size is n, the dataset contains 10*n examples/training elements, then it takes 10 iterations to complete 1 epoch.



Hope this helps.