Skip to content

Commit dbc3905

Browse files
committed
add latex support
1 parent 101fbf0 commit dbc3905

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

readme.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,14 @@ For example:
128128
```
129129

130130
Note: If we view `x1` as
131-
$$
132-
X_1=
133-
\left[ {\begin{array}{cc}
134-
x_1 & x_2 \\
135-
x_3 & x_4 \\
136-
\end{array} } \right]
137-
$$
131+
132+
![equation](https://latex.codecogs.com/svg.latex?%5Clarge%20X_1%3D%20%5Cleft%5B%20%7B%5Cbegin%7Barray%7D%7Bcc%7D%20x_1%20%26%20x_2%20%5C%5C%20x_3%20%26%20x_4%20%5C%5C%20%5Cend%7Barray%7D%20%7D%20%5Cright%5D)
133+
138134
and view `x2` as
139-
$$
140-
X_2=
141-
\left[ {\begin{array}{cc}
142-
x_5 & x_6 \\
143-
x_7 & x_8 \\
144-
\end{array} } \right]
145-
$$
146-
​ Then `z` is equvilant to $$z=\frac{1}{2}(x_1+x_2+x_3+x_4)+(x_5+x_6+x_7+x_8)​$$
135+
136+
![equation](https://latex.codecogs.com/svg.latex?%5Clarge%20X_2%3D%20%5Cleft%5B%20%7B%5Cbegin%7Barray%7D%7Bcc%7D%20x_5%20%26%20x_6%20%5C%5C%20x_7%20%26%20x_8%20%5C%5C%20%5Cend%7Barray%7D%20%7D%20%5Cright%5D)
137+
138+
​ Then `z` is equvilant to ![equation](https://latex.codecogs.com/svg.latex?%5Clarge%20z%3D%5Cfrac%7B1%7D%7B2%7D%28x_1+x_2+x_3+x_4%29+%28x_5+x_6+x_7+x_8%29)
147139

148140
* Call `backward()` function to compute gradients automatically
149141

@@ -154,9 +146,8 @@ For example:
154146
`z.backward()` is actually just the derivative of z with respect to inputs (tensors whose `is_leaf` and `requires_grad` both equals `True`)
155147

156148
For example, if we want to know the derivative of `z` with respect to `x_1`, it is:
157-
$$
158-
\frac{\partial z}{\partial x_1}=0.5
159-
$$
149+
150+
![equation](https://latex.codecogs.com/svg.latex?%5Clarge%20%5Cfrac%7B%5Cpartial%20z%7D%7B%5Cpartial%20x_1%7D%3D0.5)
160151

161152
* Check the gradients using `.grad`
162153

0 commit comments

Comments
 (0)