This repository contains two implementations on how to use keras-tuner
for hyperparameter tuning on keras
-based and sklearn
-based models.
It is recommended to follow the step by step described below. However, you can adapt the code to your needs.
Build the docker image as follows:
$ docker build -t keras-tuner:v1 .
Run the container and access it through the shell.
Note: It is recommended that you mount the current directory so that you have access to the python scripts.
If you want to skip mounting the current directory, you will have to modify Dockerfile
to add COPY
commands to move scripts from the image build.
$ docker run -it -v $PWD:/home/app/ keras-tuner:v1 /bin/bash
To optimize the sample model provided in the sklearn_tuning.py
, run:
$ python -B sklearn_tuning.py
To optimize the sample model provided in the keras_tuning.py
, run:
$ python -B keras_tuning.py
then, for launching the TensorBoard
visualization, run:
$ tensorboard --logdir tensorboard
Note: The script keras_tuning.py contains the variable KERAS_PROJECT_TENSORBOARD = "tensorboard"
, this is the reason why the --logdir
is pointing to tensorboard
.