diff --git a/beginner_source/examples_autograd/polynomial_autograd.py b/beginner_source/examples_autograd/polynomial_autograd.py index 65ab5892d9e..05744ff560c 100755 --- a/beginner_source/examples_autograd/polynomial_autograd.py +++ b/beginner_source/examples_autograd/polynomial_autograd.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 computes the forward pass using operations on PyTorch Tensors, and uses PyTorch autograd to compute gradients. diff --git a/beginner_source/examples_autograd/polynomial_custom_function.py b/beginner_source/examples_autograd/polynomial_custom_function.py index 33fc1a24688..4a0ea4fc9d8 100755 --- a/beginner_source/examples_autograd/polynomial_custom_function.py +++ b/beginner_source/examples_autograd/polynomial_custom_function.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -""" +r""" PyTorch: Defining New autograd Functions ---------------------------------------- A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi` -to :math:`pi` by minimizing squared Euclidean distance. Instead of writing the +to :math:`\pi` by minimizing squared Euclidean distance. Instead of writing the polynomial as :math:`y=a+bx+cx^2+dx^3`, we write the polynomial as :math:`y=a+b P_3(c+dx)` where :math:`P_3(x)=\frac{1}{2}\left(5x^3-3x\right)` is the `Legendre polynomial`_ of degree three.