Skip to content

Deep Learning and Transformers Explained

See how a neural network learns, from one neuron to a small transformer. You train a network that routes Larkfield's support tickets, find out why its training goes wrong and fix it, and then open a real pretrained language model to see what is inside.

Read every lesson as a guest, or sign in to enroll and track your progress.

What you'll learn

By the end of this course, you will be able to:

  • Explain forward and backward passes.
  • Train and diagnose a small neural network.
  • Interpret embeddings and attention.
  • Relate transformer training to inference and resource needs.

About this course

Deep learning powers the image, speech and language tools that you use every day. From the outside, it can look like magic. From the inside, it is a few simple ideas repeated many times: weighted sums, a measure of error, and small steps that make the error smaller.

In this course, you build those ideas up one at a time. You start from the logistic regression that you already know and turn it into a neural network. You see how the network learns, why its training sometimes fails, and how to find the cause from evidence instead of guessing.

Larkfield’s help desk gives you one task for the whole course: read a ticket and send it to the right team. You solve it with a small network, then with embeddings and attention, and finally with a tiny transformer that you train yourself. You measure each one against the simple linear model of the machine learning course, which stays the better router on these tickets. The tiny transformer is the weakest of them, because a few thousand tickets are too few to learn a language from nothing. At the end, you open a real pretrained language model, the answer to that problem. You read its parts and measure what it costs to run.

Diagrams, interactive explorers and annotated outputs carry the main ideas, so the text stays short. Every example runs on an ordinary computer without a graphics card.

Before you start

You completed Python for Practical AI Engineering, Essential Mathematics and Statistics for AI, and Machine Learning, From Problem to Reliable Model, or you have the same skills. You need a free Google or Kaggle account for the notebooks, or Python 3.12 or later on your computer. Everything runs on an ordinary computer without a graphics card, and all tools are free.

Courses to take first: Python for Practical AI Engineering, Essential Mathematics and Statistics for AI, Machine Learning: From Problem to Reliable Model.

Who this is for

People who finished Machine Learning, From Problem to Reliable Model, or know the same basics, and want to understand how neural networks and transformers really work. Fresh graduates and professionals moving into AI roles.

How we made this course

Experienced AI practitioners designed this course. AI helped us draft the content; people chose the teaching approach and the examples, and reviewed every lesson. The outputs that you see are the actual results of running the code. How we make our courses

Inside the course

Module 1What a neural network is

3 lessons

Learn what a neural network is, starting from the logistic regression of the machine learning course. One neuron is a weighted sum, a layer is many neurons, and activations let a network draw curved boundaries that one straight line cannot.

  1. What deep learning is45 min
  2. Neurons and layers50 min
  3. Why layers need activations55 min

Module 2Tensors and PyTorch

3 lessons

Meet tensors, the arrays that hold every number a network uses, and learn to read their shapes. Set up PyTorch, check that it works, and run Larkfield's tickets through a first, untrained network.

  1. Tensors and shapes50 min
  2. Set up PyTorch40 min
  3. The forward pass60 min

Module 6Assemble a transformer

3 lessons

Assemble a transformer block from attention, a feed-forward layer, residual connections and normalization. Add positions and masks, train a tiny transformer on the tickets, and compare the two ways language models learn from raw text.

  1. Transformer blocks55 min
  2. Position and masking50 min
  3. Training objectives45 min

Module 8OptionalUnder the hood: the mathematics

4 optional lessons

Go deeper with the mathematics behind the course's ideas. Turn text into vectors with counts, TF-IDF and embeddings, see how word2vec and GloVe learn word meaning from raw text, write attention in matrix form, and follow the original 2017 transformer step by step. Optional: the certificate does not require these lessons.

  1. From counts to meaning: bag of words, TF-IDF and embeddingsOptional50 min
  2. How embeddings learn meaning: word2vec and GloVeOptional55 min
  3. The mathematics of attentionOptional55 min
  4. The original transformer, step by stepOptional60 min

Final module · choose at least oneCase studies

4 case studies

Four end-to-end case studies on open data. Classify clothing images, test a neural network against gradient boosting on a table, fine-tune a small transformer, and train a tiny language model. Complete at least one for the certificate; each one is a portfolio piece.

Complete at least one case study for the certificate. The others are optional. What each one covers

  1. Classify clothing images120 min
  2. Deep network or gradient boosting?120 min
  3. Fine-tune a small transformer120 min
  4. Train a tiny language model120 min

After the case studiesFinal assignment

Use every module in one practice project. You collect evidence, and check it against the course outcomes.

  1. Final assignment240 min

Case studies

Realistic projects from start to finish, on real data, with every output explained. Each one makes a portfolio piece. Complete at least one for the certificate; the others are optional.

  1. Classify clothing images2 hr

    Train and diagnose a small network on Fashion-MNIST end to end: a baseline, training curves, a confusion matrix, the errors it makes, and a saved, reproducible model.

  2. Deep network or gradient boosting?2 hr

    Compare a neural network with gradient boosting on an open tabular dataset under the same split and metric, and decide honestly whether the network is worth its cost.

  3. Fine-tune a small transformer2 hr

    Adapt a small pretrained transformer to a text classification task on open data, compare it with a model trained from scratch, and measure what the pretraining bought.

  4. Train a tiny language model2 hr

    Train a character-level transformer on public-domain text with next-token prediction, watch its samples improve during training, and measure loss on held-out text.

Learn more from the community

Other people teach this subject well too. We chose these to go with this course. They open on other sites.See all community picks

Reviews

Loading the reviews…

    Took this course? Sign in to review it. Learners can write a review after they complete 25% of the lessons.

    Share this course