File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
beginner_source/examples_autograd Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 4
4
-------------------------------
5
5
6
6
A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi`
7
- to :math:`pi` by minimizing squared Euclidean distance.
7
+ to :math:`\ pi` by minimizing squared Euclidean distance.
8
8
9
9
This implementation computes the forward pass using operations on PyTorch
10
10
Tensors, and uses PyTorch autograd to compute gradients.
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
- """
2
+ r """
3
3
PyTorch: Defining New autograd Functions
4
4
----------------------------------------
5
5
6
6
A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi`
7
- to :math:`pi` by minimizing squared Euclidean distance. Instead of writing the
7
+ to :math:`\ pi` by minimizing squared Euclidean distance. Instead of writing the
8
8
polynomial as :math:`y=a+bx+cx^2+dx^3`, we write the polynomial as
9
9
:math:`y=a+b P_3(c+dx)` where :math:`P_3(x)=\frac{1}{2}\left(5x^3-3x\right)` is
10
10
the `Legendre polynomial`_ of degree three.
You can’t perform that action at this time.
0 commit comments