COMP5046 — Natural Language Processing

Lecture 3: Models — Non-linear

MLP · activations · backprop · regularisation · RNN · vanishing/exploding gradients.

How to use: bullets first · Recall = self-test · Quiz Hub = retrieval practice.

MLP

Non-linearity

RecallWhy can’t a single linear layer solve XOR? Name three activations.

Optimisation

Gradients & backprop

RecallWhat does backprop compute? Why chain rule?

Generalisation

Regularisation

RecallTwo regularisers that change the loss; one that changes the forward pass only during training.

Sequences

RNNs

\(\mathbf{x}_t\)
\(W\mathbf{x}_t + V\mathbf{h}_{t-1}\)
tanh
\(\mathbf{h}_t\)
\(U\mathbf{h}_t\)
\(\mathbf{y}_t\)

RecallElman update: what two terms feed into \(\mathbf{h}_t\)?

Heads

Transducer vs encoder

RecallDifference between transducer and encoder use of RNN output.

Long sequences

Exploding & vanishing gradients

RecallOne fix for exploding; why vanishing hurts learning long dependencies.

Lab

Workshop 3

Quick practice

Why can a two-layer network with ReLU solve XOR when a single linear layer cannot?
ReLU is faster than sigmoid
Two layers have more parameters
The hidden layer re-embeds inputs so classes become linearly separable
XOR requires at least three layers
What is the difference between using an RNN as a transducer and as an encoder?
Transducer uses LSTM; encoder uses GRU
Transducer outputs at every step; encoder produces one vector from the final hidden state
They are the same but with different names
Encoder processes left-to-right; transducer processes right-to-left

Chapter quizzes

Self-test + flashcards.

Open Quiz Hub Chapter flashcards