← All open source projects

Keras

keras-team/keras

Keras is a high-level Python API for deep learning with support for multiple computation backends.

Forks 19,736
Author keras-team
Language Python
License Apache-2.0
Synced 2026-06-20

What it is

Keras is a high-level deep learning API for Python. Modern Keras 3 supports multiple backends, including JAX, TensorFlow, PyTorch, and OpenVINO for inference, while keeping a user-friendly interface.

The project is known for the phrase “deep learning for humans”. Neural networks are not made trivial, but building, training, and evaluating models becomes more readable and faster for experiments.

How the approach works

Keras offers several levels. You can build a sequential model from layers, describe more complex architectures with the functional API, or write custom layers and training loops when the standard path is not enough.

The multi-backend model matters for teams that want a familiar API while choosing the computation backend based on task, infrastructure, and performance.

Minimal model

This example shows the high-level Keras style: a model is built from layers, compiled with a loss and metric, then trained on data.

Language: Python
import keras
from keras import layers

model = keras.Sequential([
    layers.Dense(64, activation="relu"),
    layers.Dense(10, activation="softmax")
])

model.compile(
    optimizer="adam",
    loss="sparse_categorical_crossentropy",
    metrics=["accuracy"]
)

model.fit(x_train, y_train, epochs=5, validation_split=0.2)

Why it is popular

Keras lowers the entry barrier for neural networks. Instead of writing every low-level operation first, a user can quickly build a model, test an idea, and then go deeper.

For teams, that shortens the distance from hypothesis to experiment. A readable API makes models easier to discuss, change, and share.

Strengths

The main strength is model development ergonomics. Layers, compilation, training, callbacks, saving, and component reuse form a coherent path without excessive manual work.

It also balances simplicity and extension. A beginner can start with `Sequential`, while an experienced developer can move to custom layers, losses, and training control.

Limits

A high-level API does not remove the need to understand data, metrics, and model errors. Keras can build a network quickly, but it cannot guarantee that the problem or dataset is right.

For highly custom research, working closer to a backend may be more convenient. Keras can remain a layer for part of the project or give way to lower-level code.

Who it fits

Keras fits researchers, machine learning engineers, teachers, and developers who need to build and test deep learning models quickly.

It works especially well where readable experiments, team learning, and gradual movement from simple to complex models matter.