Skip to course content
Free PyTorch course

Advanced Deep Learning with PyTorch

Module 09 Activity

Scenario

Use a pretrained encoder for a text classification task, and report it so a reviewer can judge it.

Task

  1. Pass a batch through one encoder block and confirm the shape is unchanged.
  2. Tokenise, pad and mask a small batch. Show that masked pooling differs from naive pooling.
  3. Freeze the encoder, cache the pooled vectors, and fit a classical head on them.
  4. Fine-tune end to end with the encoder at a much lower rate than the head.
  5. Evaluate both against the majority baseline.
  6. Split the metric by group and report per-slice accuracy.

Deliverable

A classification report with both approaches, the baseline, per-slice accuracy, and a limitation.

Check your work

The slice rule

Decide the slices before looking at results. Choosing them afterwards is selection, not measurement.