How to tune hyper-parameters when feeding data from flow_from_directory

422 views Asked by At

I have the training data structured such flow_from_directory can be used and trains the network as well.

Now I wish to perform hyper-parameter tuning using GridSearchCV. When using GridSearchCV along with keras models the fit method expects array-like objects for input and labels. Is there any way I can use flow_from_directory and perform hyper-parameter tuning.

1

There are 1 answers

0
jonathanrocher On

Found 2 solutions as of today:

  1. https://github.com/maxpumperla/hyperas, through the way to specify parameters is different from the GridSearchCV.
  2. subclass KerasClassifier yourself to implement the .fit() method as in https://github.com/keras-team/keras/issues/4530 but that requires more work. I hope one day, Keras productizes a solution for this...