Stuck on derivative of logarithm of sum of exponentials

7.7k Views Asked by At

let's say that I need to calculate the following expression:

$$ \frac{\partial\mathrm{log}(\mathrm{exp}(w_1 * x_1 + b_1) + \mathrm{exp}(w_2 * x_2 + b_2))}{\partial w_1} $$

How do I start? The rules that I know about derivation, exponential and logarithm are not very useful in this situation.

1

There are 1 best solutions below

2
On BEST ANSWER

This is just an application of the chain rule

$$ \frac{\partial\mathrm{log}(\mathrm{exp}(w_1 * x_1 + b_1) + \mathrm{exp}(w_2 * x_2 + b_2))}{\partial w_1} = \frac{\partial}{\partial w_1}(log(f(w_1)) = \frac{\frac{\partial f(w_1)}{\partial w_1}}{f(w_1)} $$

So your final answer is:

$$ \frac{x_1\mathrm{exp}(w_1x_1+b_1)}{\mathrm{exp}(w_1 * x_1 + b_1) + \mathrm{exp}(w_2 * x_2 + b_2))}$$