skillfed

keras-tuner

A Hyperparameter Tuning Library for Keras

keras-tuner v1.4.8 180.9K downloads/30d#10,137 on PyPI2,923
Permissive license Apache License 2.0 AGING released

What it is and what it does

KerasTuner is a hyperparameter optimization framework designed to automate the search for optimal model configurations in Keras. It provides a define-by-run syntax where you write a function that builds your model and uses the `hp` argument to declare which hyperparameters to tune, then delegates the search to one of several built-in algorithms: Bayesian Optimization, Hyperband, or Random Search. The framework handles the trial management, evaluation, and model selection, returning the best-performing model based on your chosen objective metric.

The package integrates with keras as its primary dependency and relies on packaging, requests, kt-legacy, grpcio, and protobuf for configuration management, API communication, and serialization. KerasTuner is intended for researchers and practitioners who need to systematically explore hyperparameter spaces without manually implementing search logic, and it is designed to be extensible for experimenting with custom search algorithms.

Use it for:

  • Automatically find optimal layer sizes, learning rates, and activation functions for a model without manual trial-and-error.
  • Compare multiple search algorithms (Bayesian, Hyperband, Random) on the same model to identify which converges fastest.
  • Scale hyperparameter search across distributed systems using the framework's built-in support for parallel trials.
  • Experiment with new search algorithms by extending KerasTuner's base classes for research or domain-specific optimization.
  • Reduce model development time by systematically tuning a large number of hyperparameters in a single reproducible workflow.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

KerasTuner automates hyperparameter optimization for Keras models using built-in search algorithms (Bayesian Optimization, Hyperband, Random Search) and a define-by-run configuration syntax.

Yes, with conditions. KerasTuner is a permissively licensed tool for automating hyperparameter search in Keras models, with low install friction and no known vulnerabilities. However, its maintenance status is aging (276 days since last release), so verify compatibility with your keras version and check for any recent issues before committing to production workflows. It is well-suited for research, prototyping, and systematic tuning tasks.

Install

keras-tuner on PyPI

pip

pip install keras-tuner

uv

uv add keras-tuner

poetry

poetry add keras-tuner

Installing keras-tuner

Before you install

Low install friction with a pure-Python wheel. The package depends on keras, packaging, requests, kt-legacy, grpcio, and protobuf. Maintenance status is aging—last release was 276 days ago, though the repository remains active with a recent commit on 2025-12-01.

License in practice

Licensed under Apache License 2.0 (permissive), so you can use, modify, and distribute the package freely in commercial and private projects without restriction.

Quickstart

pip install keras-tuner

import keras_tuner
from keras import Sequential, layers

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

tuner = keras_tuner.RandomSearch(build_model, objective='val_loss', max_trials=5)
tuner.search(x_train, y_train, epochs=5, validation_data=(x_val, y_val))
best_model = tuner.get_best_models()[0]

Requires Python 3.8+ and a compatible version of keras.

Verify before relying

  • Whether aging maintenance status (276 days since last release) affects stability or feature completeness.
  • Performance characteristics and scalability limits for large hyperparameter search spaces.
  • Specific keras and protobuf version compatibility requirements.

Package facts

License Apache License 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 6 — keras, packaging, requests, kt-legacy, grpcio, protobuf
Maintenance aging — 276 days since the last release
Last repo commit
First released
Downloads 180,913/month — #10,137 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: keras_tuner-1.4.8-py3-none-any.whl

Intended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Software Development

Tags

hyperparameter tuning kerasneural network hyperparameter optimizationbayesian optimization keras modelsautomated model tuninghyperband search algorithmkeras hyperparameter searchmodel parameter optimization framework
hyperparameter-optimizationkeras-integrationneural-architecture-search

More Software Development packages