Exercises

ex-sp-ch33-01

Easy

Load a pre-trained ResNet-18 from torchvision and print the architecture.

ex-sp-ch33-02

Easy

Replace the classifier head of ResNet-18 for a 5-class task. Count trainable parameters.

ex-sp-ch33-03

Easy

Freeze all layers except the last two and verify with requires_grad checks.

ex-sp-ch33-04

Easy

Export a simple MLP to ONNX format and verify the exported file loads.

ex-sp-ch33-05

Easy

Apply post-training dynamic quantisation (INT8) to a linear model and compare inference time.

ex-sp-ch33-06

Medium

Fine-tune a pre-trained ResNet-18 on CIFAR-10 using discriminative learning rates.

ex-sp-ch33-07

Medium

Implement LoRA for nn.Linear and apply it to a pre-trained model. Compare parameter counts.

ex-sp-ch33-08

Medium

Implement PnP deblurring using a pre-trained DnCNN denoiser.

ex-sp-ch33-09

Medium

Compare feature extraction vs full fine-tuning on a small dataset (100 images per class).

ex-sp-ch33-10

Medium

Export a CNN to TorchScript via tracing and scripting. Compare outputs.

ex-sp-ch33-11

Hard

Implement gradual unfreezing: unfreeze one layer group per epoch during fine-tuning.

ex-sp-ch33-12

Hard

Implement PnP channel estimation using DRUNet on the OFDM resource grid.

ex-sp-ch33-13

Hard

Implement domain-adversarial training for sim-to-real channel model transfer.

ex-sp-ch33-14

Challenge

Fine-tune a pre-trained transformer for channel prediction and compare to from-scratch training.

ex-sp-ch33-15

Challenge

Build a complete deployment pipeline: train, quantise, export to ONNX, benchmark inference.