![]() |
VOOZH | about |
Keras is a deep learning API that simplifies the process of building deep neural networks. Initially it was developed as an independent library, Keras is now tightly integrated into TensorFlow as its official high-level API. It supports multiple backend engines like TensorFlow, Theano and Microsoft Cognitive Toolkit (CNTK). Keras makes it easier to train and evaluate deep learning models without requiring extensive knowledge of low-level operations.
1. Since Keras is now part of TensorFlow, it can be installed easily using pip:
This command installs TensorFlow 2.x, which includes Keras.
2. To check the installation, open Python and run:
Output:
TensorFlow Version: 2.18.0
Keras Version 3.8.0
Keras was developed by Google engineer named François Chollet. It was developed as part of research project called ONEIROS (Open-ended Neuro-Electronic Intelligent Robot Operating System) and it was released in March 2015.
The goal of Keras was to enable experimentation with deep neural networks. Later, Keras was tagged into TensorFlow as 'tf.keras', which made it an official high-level API of TensorFlow while having its own version that could interface with other computational backends like Theano or CNTK.
| Aspect | Key Points |
|---|---|
| Simplicity | High-level API for the full ML workflow and reduces manual effort with clear, productive interfaces. |
| Customizability | Easily extendable with custom layers, losses and preprocessing, It supports both functional API and low-level model building. |
| Compatibility | Runs on TensorFlow, Theano and CNTK allowing consistent performance across CPU and GPU platforms. |
| Scalability and Performance | Uses scalable backends like TensorFlow |
| Fast Experimentation | Uses simple tools to build models quickly, making it great for research and testing |
Keras provides two main ways to build models:
The Sequential API are easy to work with models with a single input and output and a linear stack of layers
Here’s how you can define a Sequential model:
Functional API allows more flexibility in creating complex architectures. You can create models with shared layers, multiple inputs/outputs and skip connections.
For example: