In mnist notebook, inside
lm.fit_generator(batches, batches.N, nb_epoch=1,
validation_data=test_batches, nb_val_samples=test_batches.N)
what is batches.N represents and why it is necessary?
In mnist notebook, inside
lm.fit_generator(batches, batches.N, nb_epoch=1,
validation_data=test_batches, nb_val_samples=test_batches.N)
what is batches.N represents and why it is necessary?
Take a look at the documentation to understand what each argument does.
https://keras.io/models/sequential/
steps_per_epoch: Total number of steps (batches of samples) to yield from generator before declaring one epoch finished and starting the next epoch. It should typically be equal to the number of unique samples of your dataset divided by the batch size.
Already did that. Thatâs what I was thinking too. steps_per_epoch. Such a silly one. Thank you Vishnu.
It actually depends on the Keras version you are using.
For recent versions (starting with 2.0) steps_per_epoch interpretation is indeed correct.
On older versions (up to 1.2.2) the parameter had a slightly different name and interpretation
Keras 1.2.2 docs : https://faroit.github.io/keras-docs/1.2.2/models/sequential/
samples_per_epoch: integer, number of samples to process before going to the next epoch.
Noted. thanks
Is the âbatches.Nâ equals to âbatches.nb_sampleâ in the code? I ask this because when I use âbatches.Nâ, it will throw âAttributeError: âDirectoryIteratorâ object has no attribute âNââ. However, when I use âbatches.nb_sampleâ, the result looks the same as Jeremyâs.
It may something have to do with keras version. nb_sample was before keras 2 I think.
Hi @VishnuSubramanian,
How can we find the attributes of the batches generator.
For example : batches.N
What are the other attributes does the batches object has? I tried looking at the
keras documentation used in the Part 1 course https://faroit.github.io/keras-docs/1.1.1/ couldnât find the details I was looking for?
It details the various methods of fit_generator etcâŚ
I do not entirely rely on the tab operator of Jupyter notebook to find the list of attributes the object supports⌠if possible any pointers on the documentation would greatly helpâŚ
havin