PyTorch Recipes¶
Recipes are bite-sized bite-sized, actionable examples of how to use specific PyTorch features, different from our full-length tutorials.
Recipes are bite-sized bite-sized, actionable examples of how to use specific PyTorch features, different from our full-length tutorials.
Learn how to use PyTorch packages to prepare and load common datasets for your model.
Learn how to use PyTorch's torch.nn package to create and define a neural network the MNIST dataset.
Learn how state_dict objects, Python dictionaries, are used in saving or loading models from PyTorch.
Learn about the two approaches for saving and loading models for inference in PyTorch - via the state_dict and via the entire model.
Saving and loading a general checkpoint model for inference or resuming training can be helpful for picking up where you last left off. In this recipe, explore how to save and load multiple checkpoints.
In this recipe, learn how saving and loading multiple models can be helpful for reusing models that you have previously trained.
Learn how warmstarting the training process by partially loading a model or loading a partial model can help your model converge much faster than training from scratch.
Learn how saving and loading models across devices (CPUs and GPUs) is relatively straightforward using PyTorch.
Learn when you should zero out graidents and how doing so can help increase the accuracy of your model.
Learn how to leverage the PyTorch dataset API to easily create a custom dataset and custom dataloader.
Learn how to use Captum attribute the predictions of an image classifier to their corresponding image features and visualize the attribution results.
Learn basic usage of TensorBoard with PyTorch, and how to visualize data in TensorBoard UI
Apply dynamic quantization to a simple LSTM model.
Learn how to export your trained model in TorchScript format and how to load your TorchScript model in C++ and do inference.
Learn how to use Flask, a lightweight web server, to quickly setup a web API from your trained PyTorch model.