Unit 10 Exercises
Exercise 1: Using Fabric
It’s been a while since we used pure PyTorch code in Unit 4. If you are interested in using Fabric, a good exercise is to convert the existing PyTorch code into Fabric — it only requires changing a handful of lines.
For this, you can use this template based on the MNIST classifier from Unit 4.
Remember, the conversion to Fabric involves
- Setting up the model and optimizer via
- Converting the data loaders via
Hint: If you prefer to run this code on a CPU instead of GPU, you don’t need to specify the accelerator. Or just set it to
Exercise 2: Confidence Intervals
If you want to practice using the confidence interval method introduced in this lecture, tru to compute a confidence interval for the MNIST classifier from Unit 4 using this template.
Hint: In this case, since it’s a relatively large test set, the confidence interval is less than a percentage point wide.
And for a more advanced challenge, you can also try to implement the other 3 confidence interval methods for this MNIST classifier.
Log in or create a free Lightning.ai account to access:
- Completion badges
- Progress tracking
- Additional downloadable content
- Additional AI education resources
- Notifications when new units are released
- Free cloud computing credits