From f5868850b6016b97591546e544893d8681c27285 Mon Sep 17 00:00:00 2001 From: Weston Barger Date: Thu, 4 Nov 2021 22:45:13 -0700 Subject: [PATCH] Convert docstring to literal and fix math rendering typo --- beginner_source/examples_autograd/polynomial_autograd.py | 2 +- .../examples_autograd/polynomial_custom_function.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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.