[Math] Partial derivative of the logistic function

calculuspartial derivative

I'm trying to compute the partial derivative of the logistic function with respect to one parameter. I computed it but I just need someone to confirm my calculations.

Definitions: Suppose we have a parameter vector $w = [ w_1, w_2]$ and a feature vector $x = [x_1, x_2] $.

The logistic function: $f(w.x) = \frac{1}{1+e^{-w.x}}$.

I need to compute the partial derivative of $f$ with respect to $w_1$ for example. Here is my calculations:

$\frac{\partial f}{w_1} = \frac{x_1 . e^{-w.x}}{(1+e^{-w.x})^2}$

$\frac{\partial f}{w_2} = \frac{x_2 . e^{-w.x}}{(1+e^{-w.x})^2}$

So is my calculation correct for the partial derivatives?

Best Answer

Yes, that is correct. You even have the sign right.