How mrdbourke/pytorch-deep-learning works
This repository is primarily a hands-on PyTorch course rather than a single production service. Its documented learning path progresses from tensor fundamentals and general workflow through classification, computer vision, custom datasets, modular training, transfer learning, experiment tracking, paper replication, and model deployment. The clearest executable product slice is the modular image-classification pipeline: a script loads directory-based food images, creates DataLoaders, constructs TinyVGG, trains and evaluates it epoch by epoch, then saves weights; a separate prediction utility loads an image and renders its predicted class and probability. Course notebooks, Markdown lessons, exercises, slides, demos, and pretrained artifacts surround that workflow. The graph emphasizes sampled source code and documented course entry points. Deployment and experiment-tracking material are documented in the README but their implementation is not sampled here, so those relationships are intentionally left broad rather than inferred.
Main entry points: engine.py Training Engine · model_builder.py TinyVGG Model · predictions.py Image Predictor · data_setup.py DataLoaders
Components 25
Course Curriculum
Documented lessons and learning entry points
- PyTorch Fundamentals · Tensor and neural-network foundations
00_pytorch_fundamentals.ipynb - PyTorch Workflow · End-to-end modeling workflow
01_pytorch_workflow.ipynb - Computer Vision · Vision models and datasets
03_pytorch_computer_vision.ipynb - Custom Datasets · ImageFolder and custom data foundations
04_pytorch_custom_datasets.ipynb - Going Modular · Converts notebook work into Python modules
05_pytorch_going_modular.md - Transfer Learning · Adapts pretrained models
06_pytorch_transfer_learning.ipynb - Experiment Tracking · Tracks model experiments
07_pytorch_experiment_tracking.ipynb - Paper Replication · Research-oriented PyTorch project
08_pytorch_paper_replicating.ipynb - Model Deployment · Publishes a trained FoodVision model
09_pytorch_model_deployment.ipynb - Course Guide · Course outline and recommended progression
README.md - Course Helpers · Dataset download, plotting, metrics, and reusable helpers
helper_functions.py
Modular Food Classification
Executable TinyVGG training workflow
- Food Image Dataset · Pizza, steak, and sushi train/test directories
data/pizza_steak_sushi.zip - DataLoaders · ImageFolder datasets, transforms, batching, and class names
going_modular/going_modular/data_setup.py - TinyVGG Model · Two convolution blocks and a classifier
going_modular/going_modular/model_builder.py - Training Engine · Epoch loop with train_step and test_step metrics
going_modular/going_modular/engine.py - Training Script · Configures paths, hyperparameters, model, optimizer, and training
going_modular/going_modular/train.py - Loss Optimizer · CrossEntropyLoss and Adam update model parameters
going_modular/going_modular/train.py - Epoch Metrics · Train/test loss and accuracy collected per epoch
going_modular/going_modular/engine.py
Image Inference
Single-image prediction and visualization
- Image Predictor · Preprocesses image, runs inference, maps logits to class probability
going_modular/going_modular/predictions.py - Prediction Plot · Displays image with predicted class and probability
going_modular/going_modular/predictions.py
Model Artifacts
Persisted trained weights
- Weight Saver · Writes model state_dict to a .pth/.pt file
going_modular/going_modular/utils.py - TinyVGG Weights · Generated checkpoint; repository also contains pretrained examples
going_modular/models/05_going_modular_script_mode_tinyvgg_model.pth
Other components
- Learner · Student working through notebooks or scripts
- Target Image · Image selected for prediction
- PyTorch Runtime · Tensor, neural-network, optimizer, and inference runtime
Connections 30
- Learner → Course Guide: starts with
- Course Guide → PyTorch Fundamentals: follows
- PyTorch Fundamentals → PyTorch Workflow: builds toward
- PyTorch Workflow → Computer Vision: extends into
- Computer Vision → Custom Datasets: prepares
- Custom Datasets → Going Modular: modularizes
- Going Modular → Transfer Learning: continues to
- Transfer Learning → Experiment Tracking: supports
- Experiment Tracking → Paper Replication: advances to
- Paper Replication → Model Deployment: culminates in
- Food Image Dataset → DataLoaders: feeds
- Training Script → DataLoaders: creates
- Training Script → TinyVGG Model: instantiates
- DataLoaders → Training Engine: provides batches
- TinyVGG Model → Training Engine: is trained by
- Training Script → Training Engine: orchestrates
- Loss Optimizer → Training Engine: configures updates
- Training Engine → Epoch Metrics: collects
- TinyVGG Model → Loss Optimizer: parameters
- Training Engine → Weight Saver: hands model
- Weight Saver → TinyVGG Weights: writes
- PyTorch Runtime → DataLoaders: runtime
- PyTorch Runtime → TinyVGG Model: implements
- PyTorch Runtime → Training Engine: executes
- Target Image → Image Predictor: selected for
- TinyVGG Weights → Image Predictor: restores model
- TinyVGG Model → Image Predictor: model contract
- Image Predictor → Prediction Plot: renders
- PyTorch Runtime → Image Predictor: runs inference
- Course Helpers → Food Image Dataset: can download