keras api
Keras is a high-level deep learning API that provides an intuitive, user-friendly interface for building, training, and deploying neural networks, originally created by François Chollet in 2015 and now tightly integrated as TensorFlow's official high-level API (tf.keras). Keras prioritizes developer experience through its guiding principles: modularity (neural network components are standalone, configurable modules that can be freely combined), minimalism (each module is kept short and simple), extensibility (new components are easy to add), and working with Python (no separate configuration files — models are described in Python code). The API offers three model-building paradigms: Sequential API (linear stack of layers — simplest approach for straightforward architectures), Functional API (directed acyclic graph of layers — supports multi-input, multi-output, shared layers, and branching architectures), and Model Subclassing (full customization by subclassing the Model class — maximum flexibility for research and novel architectures). Key components include: layers (Dense, Conv2D, LSTM, Transformer, BatchNormalization, Dropout — comprehensive library of standard neural network building blocks), optimizers (SGD, Adam, AdamW, RMSprop with learning rate scheduling), loss functions (cross-entropy, MSE, custom losses), metrics (accuracy, AUC, precision, recall), callbacks (EarlyStopping, ModelCheckpoint, TensorBoard, ReduceLROnPlateau — hooks executed during training for monitoring and control), and preprocessing layers (normalization, data augmentation integrated into the model graph). Keras 3 (released 2023) is a major evolution enabling multi-backend support — the same Keras code can run on TensorFlow, JAX, or PyTorch backends, allowing users to choose the optimal backend for their use case. This multi-backend approach combines Keras's user-friendly API with the performance characteristics of each framework.