How to write mathematical formulas gracefully in Zhihu and official accounts? How to paste markdown files directly in Zhihu? I found a web site that solves this problem: MDnice.com
Writing mathematical formulas using MDnice.com and LaTeX grammar, and copying them to official accounts or Zhihu articles with one click, is so convenient! If you are not familiar with LaTeX syntax, please refer to zhihu’s question: How are the formulas on Zhihu typed?
Let’s take a look at an article formatted using MDnice.com, as follows: The following is part of a Markdown file:
Github.com/fengdu78/Da…
Typography effect
Suppose is a function that takes a vector in and returns a real number. So for the Hessian matrix, write:, or simply, the partial derivative of the matrix:
In other words, its:
Note: Hessian matrices are usually symmetric:
Like the gradient, the Hesse matrix is defined only if it is real.
It is natural to assume that the gradient is similar to the first derivative of a vector function, and that the Hesse matrix is similar to the second derivative (the notation we use also implies this relationship). This intuition is usually correct, but there are a few caveats to keep in mind. First, for a real valued function of a variable, its basic definition is: the second derivative is the derivative of the first derivative, namely:
However, for a function of a vector, the gradient of the function is a vector, and we cannot take the gradient of a quantity, that is:
This expression above makes no sense. Therefore, the Hesse matrix is not the gradient of the gradient. However, this is almost true in the following case: if we look at the first element of the gradient and take the gradient of phi with respect to phi we get:
This is row (column) of the Hesse matrix, so:
To put it simply: we can say that because:, as long as we understand, this is actually taking the gradient of each element, not the gradient of the entire vector.
And finally, notice that although we can take gradients for matrices, for this course we’re only going to consider taking Hessian matrices for vectors. This makes it a lot easier (in fact, none of the calculations we do require us to find a Hessian equation for a matrix), because a Hessian equation for a matrix would have to take partial derivatives of all the elements of the matrix, which is rather cumbersome to represent as a matrix.
Isn’t the layout beautiful? Remember markdown artifact address: mdnice.com\