Attention Mechanism
#
Attention is a deep learning mechanism that allows a model to focus on the most relevant parts of an input sequence when producing an output.
Instead of compressing the whole input into one fixed vector, attention computes a weighted combination of useful information.
Key takeaway:
Attention answers a simple question:
For the current prediction, which input tokens should the model focus on most?
- Queries, Keys, and Values
- Attention Pooling by Similarity
- Attention Pooling via Nadaraya–Watson Regression
- Attention Scoring Functions
- Dot Product Attention
- Convenience Functions
- Scaled Dot Product Attention
- Additive Attention
- Bahdanau Attention Mechanism
- Multi-Head Attention
- Self-Attention
- Positional Encoding
Why Attention Is Needed ☆
#
Traditional encoder-decoder RNN models compress the full input sequence into one context vector.
Bayesian Learning
#
Bayesian Learning is a probabilistic approach to machine learning.
Instead of only asking, “Which output should the model predict?”, Bayesian Learning asks:
Given the data we have observed, how likely is each hypothesis, class, or parameter value?
This makes Bayesian Learning useful when uncertainty matters.
It is especially important in classification, probabilistic modelling, generative models, and situations where we want to combine prior knowledge with observed data.
Knowledge Representation and Propositional Logic
#
An intelligent agent can store observations and rules, combine them through logical reasoning, and use the resulting conclusions to choose an action. Knowledge representation makes this information explicit so that the agent can reuse what it knows and reason about situations it has not directly observed.
Module topics
- Overview of Logics- Propositional, Predicate, TT-Entail, Theorem Proving
- Logic Representation of a sample agent, Proof by resolution, DPLL Algorithm, Agents based on Propositional logic
- Unification, forward chaining, Backward Chaining, Resolution
The explanations below develop knowledge-based agents and propositional reasoning, using one continuous Wumpus World example.
Training at scale requires more than dividing data between GPUs. A platform must decide where model state lives, who computes gradients, how updates are combined, and how information moves between devices.
This page focuses on the Parameter Server model and the practical constraints that determine whether adding resources makes training faster.
Topics covered:
- Parameter servers, workers, and independent scaling of storage and computation
- Training-state memory and parameter sharding
- Distributed loss, gradient aggregation, and the pull–compute–push cycle
- Communication costs, RDMA, MPI, PCIe, and NVLink
- Global batch size, learning-rate scaling, and warm-up
- Monitoring, fault recovery, and sparse versus dense workloads
Learning Objectives
#
By the end of this page, you should be able to:
Value-Based DRL: Function Approximation
#
Tabular methods store a separate value for every state or state-action pair. This becomes impractical when the state space is very large, continuous or represented by raw observations. Function approximation replaces this table with a parameterised function that can learn from observed states, generalise to related states and predict values for states not seen during training.
Course Content covered in this module:
- Function approximation
- Feature Construction for Linear Methods:
- Tile Coding
- Asymmetric Tile Coding
- Linear function approximation
- Semi-Gradient TD methods
- Off-policy function approximation and TD divergence
- TD-Gammon
Instead of memorising one value per state, the agent learns parameters shared across many states.
Learning Objectives
#
By the end of this module, you should be able to:
Distributed Deep Learning: Synchronisation and Communication
#
Distributed training divides computation between workers, but those workers rarely finish together. A training system must decide when to update the model, how much outdated information to accept, and how to reduce communication.
Relevant themes from the content outline:
- Asynchronous parallelism and parameter staleness
- Effects on convergence and variance
- System and program optimisation for neural networks
- Communication–computation trade-offs
The Parameter Server model provides the architectural foundation. Here, the focus is on the policies that determine its performance.
Ensemble Learning
#
Ensemble Learning is a machine learning approach where we combine multiple models to produce a stronger final prediction.
Instead of depending on one model, an ensemble uses a group of models and combines their outputs.
The main idea is simple:
Many weak or moderately good models can work together to produce a better and more stable model.
Key takeaway:
Ensemble Learning improves prediction by combining several models.
ML System Optimisation
#
ML System Optimisation studies how to make machine learning workloads faster, more scalable, more memory-efficient, and suitable for different hardware platforms.
The subject connects machine learning algorithms with the systems that train and deploy them: multi-core CPUs, GPUs, distributed clusters, cloud platforms, edge devices, and embedded systems.
ML system optimisation = model quality + computational efficiency + hardware awareness + scalability
The learning path begins with performance measurement and parallel computing, progresses through distributed machine learning and scale-out platforms, and concludes with model compression and resource-constrained deployment.
A transformer is a neural network architecture that uses attention as its main mechanism for processing sequences.
Unlike RNNs, transformers do not process tokens one by one.
They process many tokens in parallel and use self-attention to learn relationships between tokens.
is an architecture of neural networks
based on the multi-head attention mechanism
text is converted to numerical representations called tokens, and each token is converted into a vector via lookup from a word embedding table
Optimisation of Deep models
#
Optimizers are algorithms that update neural network parameters to reduce the loss function.
Deep networks usually have millions or billions of parameters, so there is usually no closed-form solution.
Instead, training uses iterative optimisation.
Key takeaway:
An optimiser decides how the model moves through the loss landscape towards lower loss.
- Goal of Optimization
- Optimization Challenges in Deep Learning
- Gradient Descent
- Stochastic Gradient Descent
- Minibatch Stochastic Gradient Descent
- Momentum
- Adagrad and Algorithm
- RMSProp and Algorithm
- Adadelta and Algorithm
- Adam and Algorithm
- Code Implementation and comparison of algorithms (webinar)
flowchart TD
A["Optimisers in DNN"] --> B["Gradient Descent Variants"]
A --> C["Momentum-based Optimiser"]
A --> D["Adaptive Methods"]
A --> E["Learning Rate Schedules"]
D --> D1["Parameter-specific learning rates"]
E --> E1["Learning rate changes during training"]
style A fill:#E1F5FE,stroke:#4A90E2,stroke-width:2px
style B fill:#EDE7F6,stroke:#7E57C2
style C fill:#C8E6C9,stroke:#43A047
style D fill:#FFF9C4,stroke:#FBC02D
style E fill:#F8BBD0,stroke:#D81B60
Goal of Optimisation ☆
#
The goal is to find parameters
\( \theta \)
that minimise the loss.