The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

madpower2000 (16) [Avatar] Offline
#1
Listing 6.34 Preparing the training, validation, and test generators (the same source code at Listing 6.48 Preparing higher-resolution data generators for the Jena dataset).

Three generator function introduced: train_gen(), val_gen(), test_gen(), and all three based on generator() function.
But test_gen() is never used and as I suppose must be used in predict_generator(), but in this case, error will be raised, because our test_gen() will be return both features data and labels, and predict_generator() needs only features data.
256385 (47) [Avatar] Offline
#2
I believe it would be used in a call to evaluate_generator rather than predict_generator so it should be fine to yield the list
madpower2000 (16) [Avatar] Offline
#3
I suppose you keep to Chekhov's gun principle in coding smilie

"If in the first act you have hung a pistol on the wall, then in the following one it should be fired. Otherwise don't put it there."