Data generator
Dynamically generating batches of training and validation data is important for training the CNN in an efficient manner. Loading all the data in memory before the start of training can lead to data storage issues, and it therefore makes sense to read the CAPTCHAs and build batches dynamically during training time. This leads to the optimal use of resources.
We are going to use a data generator that can be leveraged for building both training and validation batches. The generator will store the CAPTCHA file location during initialization and dynamically build batches in each epoch. The order of the files is randomly shuffled after each so that the CAPTCHA images are not traversed in the same order in each epoch. This generally ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access