Exercises
ex-sp-ch33-01
EasyLoad a pre-trained ResNet-18 from torchvision and print the architecture.
ex-sp-ch33-02
EasyReplace the classifier head of ResNet-18 for a 5-class task. Count trainable parameters.
ex-sp-ch33-03
EasyFreeze all layers except the last two and verify with requires_grad checks.
ex-sp-ch33-04
EasyExport a simple MLP to ONNX format and verify the exported file loads.
ex-sp-ch33-05
EasyApply post-training dynamic quantisation (INT8) to a linear model and compare inference time.
ex-sp-ch33-06
MediumFine-tune a pre-trained ResNet-18 on CIFAR-10 using discriminative learning rates.
ex-sp-ch33-07
MediumImplement LoRA for nn.Linear and apply it to a pre-trained model. Compare parameter counts.
ex-sp-ch33-08
MediumImplement PnP deblurring using a pre-trained DnCNN denoiser.
ex-sp-ch33-09
MediumCompare feature extraction vs full fine-tuning on a small dataset (100 images per class).
ex-sp-ch33-10
MediumExport a CNN to TorchScript via tracing and scripting. Compare outputs.
ex-sp-ch33-11
HardImplement gradual unfreezing: unfreeze one layer group per epoch during fine-tuning.
ex-sp-ch33-12
HardImplement PnP channel estimation using DRUNet on the OFDM resource grid.
ex-sp-ch33-13
HardImplement domain-adversarial training for sim-to-real channel model transfer.
ex-sp-ch33-14
ChallengeFine-tune a pre-trained transformer for channel prediction and compare to from-scratch training.
ex-sp-ch33-15
ChallengeBuild a complete deployment pipeline: train, quantise, export to ONNX, benchmark inference.