diff --git a/beginner_source/examples_nn/polynomial_nn.py b/beginner_source/examples_nn/polynomial_nn.py index ad6ba22f193..70e281ed365 100755 --- a/beginner_source/examples_nn/polynomial_nn.py +++ b/beginner_source/examples_nn/polynomial_nn.py @@ -4,7 +4,7 @@ ----------- A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi` -to :math:`pi` by minimizing squared Euclidean distance. +to :math:`\pi` by minimizing squared Euclidean distance. This implementation uses the nn package from PyTorch to build the network. PyTorch autograd makes it easy to define computational graphs and take gradients, diff --git a/beginner_source/examples_nn/polynomial_optim.py b/beginner_source/examples_nn/polynomial_optim.py index 434fb6624b3..c0d4896c8f2 100755 --- a/beginner_source/examples_nn/polynomial_optim.py +++ b/beginner_source/examples_nn/polynomial_optim.py @@ -4,7 +4,7 @@ -------------- A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi` -to :math:`pi` by minimizing squared Euclidean distance. +to :math:`\pi` by minimizing squared Euclidean distance. This implementation uses the nn package from PyTorch to build the network. diff --git a/beginner_source/examples_tensor/polynomial_numpy.py b/beginner_source/examples_tensor/polynomial_numpy.py index a1a378e50ed..059ec286ee4 100755 --- a/beginner_source/examples_tensor/polynomial_numpy.py +++ b/beginner_source/examples_tensor/polynomial_numpy.py @@ -4,7 +4,7 @@ -------------- A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi` -to :math:`pi` by minimizing squared Euclidean distance. +to :math:`\pi` by minimizing squared Euclidean distance. This implementation uses numpy to manually compute the forward pass, loss, and backward pass. diff --git a/beginner_source/examples_tensor/polynomial_tensor.py b/beginner_source/examples_tensor/polynomial_tensor.py index 1e35b0f24bd..260cf8d2849 100755 --- a/beginner_source/examples_tensor/polynomial_tensor.py +++ b/beginner_source/examples_tensor/polynomial_tensor.py @@ -4,7 +4,7 @@ ---------------- A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi` -to :math:`pi` by minimizing squared Euclidean distance. +to :math:`\pi` by minimizing squared Euclidean distance. This implementation uses PyTorch tensors to manually compute the forward pass, loss, and backward pass. diff --git a/beginner_source/pytorch_with_examples.rst b/beginner_source/pytorch_with_examples.rst index e5642dfa139..d65a959b957 100644 --- a/beginner_source/pytorch_with_examples.rst +++ b/beginner_source/pytorch_with_examples.rst @@ -26,6 +26,12 @@ between the network output and the true output. You can browse the individual examples at the :ref:`end of this page `. +To run the tutorials below, make sure you have the `torch`_ +and `numpy`_ packages installed. + +.. _torch: https://github.com/pytorch/pytorch +.. _numpy: https://github.com/numpy/numpy + .. contents:: Table of Contents :local: @@ -217,6 +223,8 @@ We can easily implement this model as a Module subclass: .. includenodoc:: /beginner/examples_nn/dynamic_net.py + + .. _examples-download: Examples @@ -229,7 +237,6 @@ Tensors .. toctree:: :maxdepth: 2 - :hidden: /beginner/examples_tensor/polynomial_numpy /beginner/examples_tensor/polynomial_tensor @@ -247,7 +254,6 @@ Autograd .. toctree:: :maxdepth: 2 - :hidden: /beginner/examples_autograd/polynomial_autograd /beginner/examples_autograd/polynomial_custom_function @@ -266,7 +272,6 @@ Autograd .. toctree:: :maxdepth: 2 - :hidden: /beginner/examples_nn/polynomial_nn /beginner/examples_nn/polynomial_optim @@ -284,4 +289,4 @@ Autograd .. raw:: html -
+
\ No newline at end of file