ferneutron / keras-tuner

This repository contains demo implementations for using keras tuner to tune hyperparameters of models in keras and scikitlearn. Additionally, it includes how to generate the visualization in Tensorboard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keras Tuner

This repository contains two implementations on how to use keras-tuner for hyperparameter tuning on keras-based and sklearn-based models.

alt text

How to use it?

It is recommended to follow the step by step described below. However, you can adapt the code to your needs.

Step 1.

Build the docker image as follows:

$ docker build -t keras-tuner:v1 .

Step 2.

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

Step 3.

3.1 Scikit-learn Optimization

To optimize the sample model provided in the sklearn_tuning.py, run:

$ python -B sklearn_tuning.py

3.2 Keras Optimization

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.

About

This repository contains demo implementations for using keras tuner to tune hyperparameters of models in keras and scikitlearn. Additionally, it includes how to generate the visualization in Tensorboard.


Languages

Language:Python 90.5%Language:Dockerfile 9.5%