leo.blog();

Keras

Keras is a machine-learning framework written in Python. It’s more like a meta-framework, it wraps multiple back-ends like PyTorch, TensorFlow, and JAX.

Picking a backend

The default backend of Keras is Tensorflow. This can be changed using the KERAS_BACKEND environment variable.

import os
os.environ["KERAS_BACKEND"] = "torch"
import keras

This snippet will use the torch backend. When I’m working on ML projects, I tend to use the torch backend, but I’ve heard good things about the JAX backend too.

Backlinks

Leave a Comment