7
$\begingroup$

I am trying to understand gradient descent algorithm by plotting the error vs value of parameters in the function. What would be an example of a simple function of the form y = f(x) with just just one input variable x and two parameters w1 and w2 such that its loss function has multiple minima? What i am trying to achieve is something similar to this : enter image description here

How does one know if the function has multiple minima without plotting the graph ? What branch of mathematics deals with this topic ?

$\endgroup$
2
  • $\begingroup$ Also see Global optimization. $\endgroup$ Commented May 23, 2019 at 12:47
  • $\begingroup$ Slightly off-topic: What is the equation of this beautiful function? Could you please share it? Thanks... $\endgroup$ Commented Apr 20, 2021 at 14:50

3 Answers 3

9
$\begingroup$

Regarding example of functions with multiple local minima I would suggest visiting a website like the Virtual Library of Simulation Experiments: Test Functions and Datasets - Optimization Test Problems from Simon Fraser University. It contains many examples of functions with many local minima. A trivial two-factor example would be something like: $x \sin(w_1 x+w_2)$. In real-life terms most functions that might reflect some seasonality/periodicity will potentially have multiple local minima relating to that seasonal/periodic effect.

The most straightforward way to asses if a particular function has multiple local minima is to use calculus. Multiple local minima would relate to multiple instances of first derivatives being zero and second derivatives being positive. As Neil mentioned: "in two dimensions (like the plot he's drawn), the second derivative is a matrix, in which case a minimum corresponds to a positive definite second derivative matrix." Moving to multivariate functions will be reflected in dimensions of the function's derivatives. The object we use in that case is the Hessian matrix (which has mentioned we want to be at least positive semi-definite).

The branch of mathematics dealing with topic is called Mathematical Optimisation. Real-life examples of optimisation tasks are extensively involved in the field of Operational Research.

$\endgroup$
1
  • 1
    $\begingroup$ You might want to add that in two dimensions (like the plot he's drawn), the second derivative is a matrix, in which case a minimum corresponds to a positive definite second derivative matrix. $\endgroup$
    – Neil G
    Commented May 13, 2017 at 19:02
5
$\begingroup$

The functions that you are looking for are known as test functions or artificial landscapes.

Wikipedia has a very nice list of test functions for optimization. I recommend looking at the references from the link directly.

$\endgroup$
1
0
$\begingroup$

If they are only a few and you can estimate a range where they will lay, you can try descent methods with different starting points that will converge to each of them.

This practice works some of the time, but as we increase the number of dimensions (or as we know less about the shape of the function), this simplistic approach will no longer be practical (see previous answers)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.