Software Development
Deep Learning with Python and PyTorch
For engineers who need to train neural networks rather than call a hosted API. The programme covers tensors and autograd, custom nn.Module architectures, the training loop and its failure signatures, regularisation and optimisation, transfer learning for vision and text, mixed precision, and export to a served runtime.
Overview
Practical learning for workplace transfer.
Deep learning projects usually stall in the same place: the loss goes to NaN, the validation curve separates from training after two epochs, the GPU sits idle while the data loader starves it, or a model that scored well in a notebook cannot be exported. These are engineering problems with known signatures, and this course teaches participants to read them. Starting from the computation graph and what autograd records, it works through weight initialisation, learning-rate schedules, normalisation and dropout, gradient clipping, and the profiling that shows whether the bottleneck is compute, memory, or I/O. Transfer learning is covered as the realistic path without large labelled corpora.
Prerequisites
Strong Python skills, prior exposure to supervised machine learning, and comfort with linear algebra notation.
Objectives
- Manipulate tensors and reason about autograd, gradients, and the computation graph.
- Implement custom architectures with nn.Module, loss functions, and optimisers.
- Write efficient Dataset and DataLoader code that keeps the accelerator busy.
- Diagnose exploding loss, overfitting, and dead training runs from their signatures.
- Fine-tune pretrained vision and language models on a limited labelled dataset.
- Export a trained model to TorchScript or ONNX and measure inference latency.
Target audience
- Machine learning engineers taking a model from prototype to service
- Data scientists experienced with scikit-learn moving into neural networks
- Computer vision engineers working on inspection, safety, or imaging tasks
- NLP practitioners fine-tuning transformer models on domain text
- R&D and simulation engineers replacing costly models with learned surrogates
- Platform engineers responsible for GPU workloads and inference cost
Program outline
A clear structure for the learning journey.
Outline points are grouped in one designed block instead of being treated as separate module cards.
01Tensors, Autograd, and the Computation Graph4 topics
- Tensor creation, dtype, device placement, broadcasting, and in-place operations
- requires_grad, backward, and what the graph retains between iterations
- torch.no_grad, detach, and the memory leaks caused by keeping graph references
- Manual gradient checks to verify a custom operation before training on it
02Building Models with nn.Module4 topics
- Layers, parameters, buffers, and the forward method contract
- Dense, convolutional, recurrent, and attention blocks and where each applies
- Weight initialisation schemes and their effect on early training stability
- Choosing a loss function that matches the task and the label encoding
03Data Loading and the Training Loop4 topics
- Custom Dataset classes, transforms, and augmentation pipelines
- DataLoader workers, pin_memory, prefetching, and diagnosing input starvation
- The canonical loop: zero_grad, forward, loss, backward, step, and evaluate
- Checkpointing, resuming, seeding, and making a run reproducible
04Optimisation, Regularisation, and Debugging4 topics
- SGD with momentum, Adam, and AdamW compared on convergence behaviour
- Learning-rate finders, warmup, cosine and step schedules
- Dropout, weight decay, batch and layer normalisation, and early stopping
- Reading NaN loss, vanishing and exploding gradients, and clipping correctly
05Transfer Learning for Vision and Text4 topics
- Freezing, partial unfreezing, and discriminative learning rates by layer
- Fine-tuning torchvision backbones for classification, detection, and segmentation
- Adapting Hugging Face transformer models to domain text and Arabic corpora
- Parameter-efficient fine-tuning with LoRA and adapter layers
06Performance, Export, and Serving4 topics
- Mixed precision with autocast and GradScaler, and gradient accumulation
- Profiling with torch.profiler to separate compute, memory, and I/O bottlenecks
- Multi-GPU training with DistributedDataParallel and its correctness pitfalls
- TorchScript and ONNX export, quantisation, and latency benchmarking
Materials provided
- Course workbook, annotated code samples, and reference notes
- Hands-on lab environment and starter repositories
- Exercises, checklists, and reusable code templates
- 4D Certificate of Completion
- Post-course technical guidance
Training Options
Programs can be delivered in-house, online, or in a blended format depending on your team's schedule, location, and learning objectives. When an external certificate or exam is included, certification rules and fees remain under the relevant awarding body's policies, while 4D provides the training and preparation support.
Why choose 4D
4D scopes this course to hardware you actually have. Trainers benchmark your GPU or cloud instance on day one, size the architecture and batch strategy to that budget, and work on your own images, sensor traces, or Arabic and English text rather than a public benchmark set. The closing session produces an exported model with measured latency and a documented retraining path.
Related courses
Python Programming Fundamentals
A hands-on introduction to Python for engineers and analysts who need working code rather than tutorial fragments. Participants build fluency with data types, collections, functions, files, and error handling, then assemble a small program that reads real data and produces a usable report.
View courseIntermediate Python and Clean Code Practices
Designed for developers whose Python works but is difficult to change. The course covers dataclasses, generators, decorators, context managers, and type hints, then applies the refactoring moves that turn a nine-hundred-line module into small tested units guarded by black, ruff, and mypy.
View coursePython Automation and Scripting for Work Tasks
Aimed at teams losing hours every week to repetitive file, spreadsheet, and reporting work. Participants automate those tasks with Python: batch file handling, Excel and CSV processing, REST API calls, email alerts, and scheduled jobs that run unattended and report clearly when something fails.
View course