Skip to content
Tutorials Center
My learning

Topics

TensorFlow and Keras Tutorial

Learn TensorFlow and Keras step by step: 40 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Are TensorFlow and Keras? Learn what TensorFlow and Keras are, how Keras 3 fits in, what you can build with them, and how this course teaches them with runnable NumPy stand-ins.
  2. 2 Installing and Your First Model Install TensorFlow 2 and Keras 3 with pip, check versions and GPU, then read a complete first model and rebuild its forward pass and parameter count in NumPy.
  3. 3 How Neural Networks Learn Understand neurons, layers, loss and gradient descent, then train a tiny network on XOR with a NumPy stand-in before using Keras's compile and fit.
  4. 4 The Keras Workflow and Backends Learn the end-to-end Keras workflow, how to pick the TensorFlow, JAX or PyTorch backend, what keras.ops is, and which model-building style to use.
  5. 5 Data Basics for Keras Prepare data for Keras models: features and labels, train/validation/test splits, scaling, one-hot labels, shuffling and batching, with NumPy examples.

Tensors and Automatic Differentiation

  1. 6 Tensors and Shapes Learn TensorFlow tensors: rank, shape and dtype, creating tensors, indexing, reshaping, stacking and converting to NumPy, with runnable NumPy stand-ins.
  2. 7 Tensor Operations and Broadcasting Master tensor math for deep learning: element-wise operations, matmul, reductions with axis, softmax, argmax and broadcasting rules, with NumPy stand-ins.
  3. 8 Variables and Data Types Learn why TensorFlow has tf.Variable for model weights, how assign works, how dtypes and tf.cast behave, and why float32 precision matters, with NumPy stand-ins.
  4. 9 Automatic Differentiation Understand automatic differentiation: how tf.GradientTape records operations and computes gradients, plus a runnable reverse-mode autodiff built from scratch.
  5. 10 Gradient Descent from Scratch Build gradient descent step by step: learning rate effects, mini-batches, a linear regression training loop in NumPy and the same custom loop in TensorFlow.

Building Models with Keras

  1. 11 Building a Dense Layer from Scratch Build a Dense layer with forward and backward passes in NumPy, check its gradients, then map every piece to keras.layers.Dense and its arguments.
  2. 12 Activation Functions Compare ReLU, leaky ReLU, sigmoid, tanh, softmax, GELU and swish in Keras: formulas, derivatives, output layer choices and how to use them in a model.
  3. 13 The Sequential API Build Keras models with the Sequential API: Input, add(), summary(), naming layers, inspecting weights, when to use it, and a NumPy shape and parameter tracker.
  4. 14 The Functional API Use the Keras Functional API to build models with multiple inputs and outputs, skip connections and shared layers, with a runnable NumPy graph stand-in.
  5. 15 Initializers and Regularizers Learn how weight initialization (Glorot, He) keeps signals stable, how L1 and L2 regularizers shrink weights, and how to set both on Keras layers.

Training and Evaluation

  1. 16 Loss Functions Choose and understand Keras losses: MSE, MAE, Huber, binary and categorical cross-entropy, from_logits, the p minus y gradient, with runnable NumPy versions.
  2. 17 Optimizers Compare SGD, momentum, RMSprop, Adam and AdamW, set learning rates and schedules, clip gradients, and watch each optimizer run on a hard problem in NumPy.
  3. 18 compile, fit, evaluate and predict Master the four Keras training methods: compile, fit with validation, evaluate and predict, read the History object, and rebuild them in a NumPy mini-framework.
  4. 19 Metrics and Validation Measure Keras models honestly: accuracy traps, confusion matrix, precision, recall, F1, ROC AUC, regression metrics, validation splits and k-fold, in NumPy.
  5. 20 Overfitting and Callbacks Detect and fight overfitting with dropout, early stopping, checkpoints and learning-rate callbacks in Keras, with runnable NumPy stand-ins for each idea.

Convolutional Networks

  1. 21 How Convolution Works Understand the convolution operation behind CNNs: kernels, sliding windows, feature maps and edge detection, built from scratch in NumPy before using Keras Conv2D.
  2. 22 Padding, Strides and Pooling Control CNN output sizes with padding and strides, use max and average pooling, and compute shapes with the output-size formula. NumPy demos and Keras Conv2D code.
  3. 23 Building a CNN with Keras Build and train a convolutional network in Keras for image classification: stacking Conv2D and pooling, reading model.summary, counting parameters and avoiding overfitting.
  4. 24 Augmentation and Transfer Learning Reduce CNN overfitting with data augmentation layers, reuse pretrained models with transfer learning, and fine-tune safely in Keras. Includes NumPy augmentation demos.

Sequences and Text

  1. 25 Text Vectorization and Embeddings Turn text into numbers for neural networks: tokenization, vocabularies, padding, the Keras TextVectorization and Embedding layers, with plain Python and NumPy demos.
  2. 26 Recurrent Neural Networks Learn how a recurrent neural network processes sequences step by step with a hidden state, build an RNN cell in NumPy, and use SimpleRNN in Keras with correct shapes.
  3. 27 LSTM and GRU Layers Understand LSTM and GRU gates, build a gated cell in NumPy, count parameters, and use LSTM, GRU, Bidirectional and stacked recurrent layers in Keras models.
  4. 28 Attention and Transformers Learn scaled dot-product attention, multi-head self-attention, positional encoding and the Transformer encoder block, with NumPy demos and Keras MultiHeadAttention code.

Data Pipelines and Saving Models

  1. 29 tf.data Pipelines Build fast input pipelines with tf.data: from_tensor_slices, map, shuffle, batch, cache and prefetch. Includes plain-Python stand-ins that show how each step behaves.
  2. 30 Loading Images and Text Datasets Load datasets from disk for Keras: image_dataset_from_directory, text_dataset_from_directory, CSV data, TFRecord files and train/validation splits, with Python stand-ins.
  3. 31 Saving and Loading Models Save and restore Keras models: the .keras format, weights-only files, checkpoints, custom objects, SavedModel export and what is stored, with a NumPy weights round trip.
  4. 32 Deploying Models Take a trained Keras model to production: export a SavedModel, serve it over REST with TensorFlow Serving, convert to TFLite, and understand quantization with NumPy demos.

Advanced Topics

  1. 33 Custom Layers and Models Write your own Keras layers and models by subclassing: build(), call(), add_weight, get_config, custom losses and metrics, plus a NumPy layer class that mirrors the pattern.
  2. 34 Custom Training Loops Write your own training loop with tf.GradientTape, override train_step, use tf.function and metrics, and see the loop's structure with a NumPy gradient descent stand-in.
  3. 35 Mixed Precision and Distributed Training Train faster with mixed precision (float16, loss scaling) and scale across GPUs with tf.distribute strategies. NumPy demos of float16 limits and data-parallel gradient averaging.
  4. 36 Autoencoders and GANs Learn autoencoders for compression and denoising and GANs for generating data: encoder, bottleneck, generator, discriminator and the training loop, with NumPy demos.

Projects and Practice

  1. 37 Project: Image Classifier Build an image classifier end to end: data split, baseline, CNN with augmentation, evaluation with a confusion matrix, error analysis and export, with a runnable NumPy mini version.
  2. 38 Project: Sentiment Classifier Build a movie-review style sentiment classifier: text preprocessing, bag-of-words baseline, Keras embedding and LSTM models, metrics beyond accuracy and error analysis.
  3. 39 Project: Time Series Forecasting Forecast a seasonal time series: chronological splits, sliding windows, naive and linear baselines, normalization without leakage, then Keras Dense, LSTM and multi-step models.
  4. 40 Practice and Troubleshooting A debugging playbook for TensorFlow and Keras: overfit one batch, shape errors, NaN losses, learning-rate checks and learning curves, plus exercises and interview questions.