10 Adopting PyTorch Lightning

 

This chapter covers:

  • Implementing PyTorch Lightning to reduce boilerplate code
  • Adding training, validation, and test support for the DC taxi model
  • Analyzing DC taxi model training and validation using Pandas

Until this chapter in the book, you wrote your own implementation of the methods that included the specific steps related to training and testing of your machine learning model. However, much of the code you wrote was unrelated to your machine learning model architecture and could have applied to a broad range of distinct models. Building on this observation, this chapter introduces you to PyTorch Lightning, a framework that can help you reduce the quantity of boilerplate, engineering code in your machine learning system, and consequently help you focus on evolving your model design and implementation.

10.1 Understanding PyTorch Lightning

This section introduces the PyTorch Lightning framework for your PyTorch DC taxi fare estimation model and teaches you the steps involved in enabling PyTorch Lightning training, validation, and test features.

Until this point in the book, you had to implement a sizable portion of Python and PyTorch boilerplate code for your machine learning model. This meant that only a few parts of your implementation were model specific such as the code to:

  • package the feature values as tensors
  • configure the neural net layers
  • calculate the tensors for the loss
  • report on the model metrics

10.1.1 Converting PyTorch model training to PyTorch Lightning

 
 

10.1.2 Enabling test and reporting for a trained model

 
 
 

10.1.3 Enabling validation during model training

 
 
 
 

10.2 Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest