Lightning AI Studios: Never set up a local environment again →

Log in or create a free Lightning.ai account to track your progress and access additional course materials  

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

  1. Setting up the model and optimizer via fabric.setup(model, optimizer)
  2. Converting the data loaders via fabric.setup_dataloaders

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 accelerator="cpu".

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:

  • Quizzes
  • Completion badges
  • Progress tracking
  • Additional downloadable content
  • Additional AI education resources
  • Notifications when new units are released
  • Free cloud computing credits
Watch Video 1

Unit 10 Exercises

Videos