Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .jenkins/validate_tutorials_built.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"prototype_source/nestedtensor",
"recipes_source/recipes/saving_and_loading_models_for_inference",
"recipes_source/recipes/saving_multiple_models_in_one_file",
"recipes_source/recipes/loading_data_recipe",
"recipes_source/recipes/tensorboard_with_pytorch",
"recipes_source/recipes/what_is_state_dict",
"recipes_source/recipes/profiler_recipe",
Expand Down
7 changes: 7 additions & 0 deletions recipes_source/loading_data_recipe.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Loading data in PyTorch
=======================

The content is deprecated. See `Datasets & DataLoaders <https://pytorch.org/tutorials/beginner/basics/data_tutorial.html>`__ instead.

.. raw:: html
<meta http-equiv="refresh" content="0; url=https://pytorch.org/tutorials/">
8 changes: 4 additions & 4 deletions recipes_source/recipes/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PyTorch Recipes
---------------------------------------------
1. loading_data_recipe.py
Loading Data in PyTorch
https://pytorch.org/tutorials/recipes/recipes/loading_data_recipe.html
https://pytorch.org/tutorials/recipes/loading_data_recipe.html

2. defining_a_neural_network.py
Defining a Neural Network in PyTorch
Expand All @@ -16,12 +16,12 @@ PyTorch Recipes
Saving and loading models for inference in PyTorch
https://pytorch.org/tutorials/recipes/recipes/saving_and_loading_models_for_inference.html

5. custom_dataset_transforms_loader.py
5. custom_dataset_transforms_loader.py
Developing Custom PyTorch Dataloaders
https://pytorch.org/tutorials/recipes/recipes/custom_dataset_transforms_loader.html


6. Captum_Recipe.py
6. Captum_Recipe.py
Model Interpretability using Captum
https://pytorch.org/tutorials/recipes/recipes/Captum_Recipe.html

Expand All @@ -45,7 +45,7 @@ PyTorch Recipes
Saving and loading multiple models in one file using PyTorch
https://pytorch.org/tutorials/recipes/recipes/saving_multiple_models_in_one_file.html

12. warmstarting_model_using_parameters_from_a_different_model.py
12. warmstarting_model_using_parameters_from_a_different_model.py
Warmstarting models using parameters from different model
https://pytorch.org/tutorials/recipes/recipes/warmstarting_model_using_parameters_from_a_different_model.html

Expand Down
163 changes: 0 additions & 163 deletions recipes_source/recipes/loading_data_recipe.py

This file was deleted.

38 changes: 19 additions & 19 deletions recipes_source/recipes/zeroing_out_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@
######################################################################
# Steps
# -----
#
#
# Steps 1 through 4 set up our data and neural network for training. The
# process of zeroing out the gradients happens in step 5. If you already
# have your data and neural network built, skip to 5.
#
#
# 1. Import all necessary libraries for loading our data
# 2. Load and normalize the dataset
# 3. Build the neural network
# 4. Define the loss function
# 5. Zero the gradients while training the network
#
#
# 1. Import necessary libraries for loading our data
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
# For this recipe, we will just be using ``torch`` and ``torchvision`` to
# access the dataset.
#
#

import torch

Expand All @@ -76,10 +76,10 @@
######################################################################
# 2. Load and normalize the dataset
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
# PyTorch features various built-in datasets (see the Loading Data recipe
# for more information).
#
#

transform = transforms.Compose(
[transforms.ToTensor(),
Expand All @@ -102,10 +102,10 @@
######################################################################
# 3. Build the neural network
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
# We will use a convolutional neural network. To learn more see the
# Defining a Neural Network recipe.
#
#

class Net(nn.Module):
def __init__(self):
Expand All @@ -130,9 +130,9 @@ def forward(self, x):
######################################################################
# 4. Define a Loss function and optimizer
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
# Let’s use a Classification Cross-Entropy loss and SGD with momentum.
#
#

net = Net()
criterion = nn.CrossEntropyLoss()
Expand All @@ -142,14 +142,14 @@ def forward(self, x):
######################################################################
# 5. Zero the gradients while training the network
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
# This is when things start to get interesting. We simply have to loop
# over our data iterator, and feed the inputs to the network and optimize.
#
#
# Notice that for each entity of data, we zero out the gradients. This is
# to ensure that we aren’t tracking any unnecessary information when we
# train our neural network.
#
#

for epoch in range(2): # loop over the dataset multiple times

Expand Down Expand Up @@ -181,13 +181,13 @@ def forward(self, x):
# You can also use ``model.zero_grad()``. This is the same as using
# ``optimizer.zero_grad()`` as long as all your model parameters are in
# that optimizer. Use your best judgment to decide which one to use.
#
#
# Congratulations! You have successfully zeroed out gradients PyTorch.
#
#
# Learn More
# ----------
#
#
# Take a look at these other recipes to continue your learning:
#
# - `Loading data in PyTorch <https://pytorch.org/tutorials/recipes/recipes/loading_data_recipe.html>`__
#
# - `Loading data in PyTorch <https://pytorch.org/tutorials/beginner/basics/data_tutorial.html>`__
# - `Saving and loading models across devices in PyTorch <https://pytorch.org/tutorials/recipes/recipes/save_load_across_devices.html>`__
4 changes: 2 additions & 2 deletions recipes_source/recipes_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Recipes are bite-sized, actionable examples of how to use specific PyTorch featu
:header: Loading data in PyTorch
:card_description: Learn how to use PyTorch packages to prepare and load common datasets for your model.
:image: ../_static/img/thumbnails/cropped/loading-data.PNG
:link: ../recipes/recipes/loading_data_recipe.html
:link: ../beginner/basics/data_tutorial.html
:tags: Basics


Expand Down Expand Up @@ -407,7 +407,7 @@ Recipes are bite-sized, actionable examples of how to use specific PyTorch featu
.. toctree::
:hidden:

/recipes/recipes/loading_data_recipe
/recipes/loading_data_recipe
/recipes/recipes/defining_a_neural_network
/recipes/torch_logs
/recipes/recipes/what_is_state_dict
Expand Down