W2A1 Notebook - Latex errors

FYI. I think the Jupyter notebooks you guys created are awesome. In case you plan on supporting VSCode in the future, I attached some parse errors in the markdown section in VSCode.

Section is Exercise 7 - softmax. All the other markdown looks great.

I suppose it is a rendering problem. Here is the link to a similar one.

I extracted those, and paste in here.

\begin{align*} softmax(x) &= softmax\left(\begin{bmatrix} x_1 && x_2 && ... && x_n \end{bmatrix}\right) \\&= \begin{bmatrix} \frac{e^{x_1}}{\sum_{j}e^{x_j}} && \frac{e^{x_2}}{\sum_{j}e^{x_j}} && ... && \frac{e^{x_n}}{\sum_{j}e^{x_j}} \end{bmatrix} \end{align*}
\begin{align*} softmax(x) &= softmax\begin{bmatrix} x_{11} & x_{12} & x_{13} & \dots & x_{1n} \\ x_{21} & x_{22} & x_{23} & \dots & x_{2n} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ x_{m1} & x_{m2} & x_{m3} & \dots & x_{mn} \end{bmatrix} \\ \\&= \begin{bmatrix} \frac{e^{x_{11}}}{\sum_{j}e^{x_{1j}}} & \frac{e^{x_{12}}}{\sum_{j}e^{x_{1j}}} & \frac{e^{x_{13}}}{\sum_{j}e^{x_{1j}}} & \dots & \frac{e^{x_{1n}}}{\sum_{j}e^{x_{1j}}} \\ \frac{e^{x_{21}}}{\sum_{j}e^{x_{2j}}} & \frac{e^{x_{22}}}{\sum_{j}e^{x_{2j}}} & \frac{e^{x_{23}}}{\sum_{j}e^{x_{2j}}} & \dots & \frac{e^{x_{2n}}}{\sum_{j}e^{x_{2j}}} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ \frac{e^{x_{m1}}}{\sum_{j}e^{x_{mj}}} & \frac{e^{x_{m2}}}{\sum_{j}e^{x_{mj}}} & \frac{e^{x_{m3}}}{\sum_{j}e^{x_{mj}}} & \dots & \frac{e^{x_{mn}}}{\sum_{j}e^{x_{mj}}} \end{bmatrix} \\ \\ &= \begin{pmatrix} softmax\text{(first row of x)} \\ softmax\text{(second row of x)} \\ \vdots \\ softmax\text{(last row of x)} \\ \end{pmatrix} \end{align*}

This can also works as a browser rendering check.

That’s a great idea to do the “in place” test! But I got a “math processing error” the first time I clicked on this thread. But doing a browser “Refresh” fixed the problem and now it renders correctly. That seems to argue that there is some flakiness in how the MathJax plugin handles the rendering of really complex LaTeX code. Sometimes it fails the first time and you need to hit Refresh to render it successfully. FWIW I’m using Chrome on an M1 MacBook Pro. Just for grins I tried FireFox as well and it renders correctly there on the first try.