Skip to content

ghsanti/keras-tuner

 
 

Repository files navigation

KerasTuner

license py-version tests codecov

jax tf pytorch

Personal fork of the great KerasTuner: Original Repo. Feel free to try it out.

Install

Check out to Codespace, or install locally:

pip install git+https://github.com/ghsanti/keras-tuner
pip install jax[cpu] # or tf, or torch.

Try example.py and see the results.

Main Changes - Detailed results and type annotations (some.)
Built-in algorithms: Find the best parameters using the the built-in algorithms:
  • Bayesian Optimization,
  • Hyperband,
  • Random Search

or extend in order to experiment with new search algorithms.

Code Example
import keras_tuner
import keras
def build_model(hp):
  model = keras.Sequential()
  model.add(keras.layers.Dense(
      hp.Choice('units', [8, 16, 32]),
      activation='relu'))
  model.add(keras.layers.Dense(1))
  model.compile(loss='mse')
  return model

tuner = keras_tuner.RandomSearch(
    build_model,
    objective='val_loss',
    max_trials=5 # tries with the same parameters.
  )

tuner.search(x_train, y_train, epochs=5, validation_data=(x_val, y_val))
best_model = tuner.get_best_models()[0]

Contributing Guide

Please refer to the CONTRIBUTING.md for the contributing guide.

About

A Hyperparameter Tuning Library for Keras

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%