» Code examples

Code examples

Our code examples are short (less than 300 lines of code), focused demonstrations of vertical deep learning workflows.

All of our examples are written as Jupyter notebooks and can be run in one click in Google Colab, a hosted notebook environment that requires no setup and runs in the cloud. Google Colab includes GPU and TPU runtimes.

Computer Vision

Natural language processing

Structured Data

Timeseries

Generative Deep Learning

Reinforcement learning

Quick Keras recipes


Adding a new code example

We welcome new code examples! Here are our rules:

  • They should be shorter than 300 lines of code (comments may be as long as you want).
  • They should demonstrate modern Keras / TensorFlow 2.0 best practices.
  • They should be substantially different in topic from all examples listed above.
  • They should be extensively documented & commented.

New examples are added via Pull Requests to the keras.io repository. They must be submitted as a .py file that follows a specific format. They are usually generated from Jupyter notebooks. See the tutobooks documentation for more details.