3
$\begingroup$

I am trying to optimize a function $f(x)$ of a vector of reals $x=<x_1, x_2, ...x_n>$. In my practical application, I have no expression for $f$ whatsoever, all I can do is given a vector $x$, calculate $f(x)$ via a deterministic experiment.

How do I go about calculating the gradient? What specific type of gradient descent would you suggest? Or do you suggest an alternative approach?

I was thinking, maybe try each $x_i$, shifting it up or down, see which way $f$ increases, and move in that direction. In other words, change only single $x_i$ at a time. Does this method have a name? Or is it flawed, and there is a better alternative? How do I approach this problem?

$\endgroup$

1 Answer 1

3
$\begingroup$

As you suggested, it's possible to approximate the gradient by repeatedly evaluating the objective function after perturbing the input by a small amount along each dimension (assuming it's differentiable). This is called numerical differentiation, or finite difference approximation. It's possible to use this for gradient-based optimization methods like vanilla gradient descent, BFGS, conjugate gradient method, etc. You can probably get away with it for small scale problems. But, it's not very efficient because the number of function evaluations needed to approximate the gradient scales with the number of variables. If your optimization problem has many variables, you'd probably be better off using a derivative-free optimization method. This class of methods doesn't require the gradient, and can be used in cases where the gradient is unavailable, or the objective function is non-differentiable. Derivative-free methods are typically less efficient than gradient based methods if an expression for the gradient is available. But, they can be more efficient than computing the gradient numerically.

$\endgroup$
3
  • $\begingroup$ Can you please recommend some derivative-free optimization methods? Are you referring to genetic algos? What else would you suggest as most practical? $\endgroup$ Commented Jun 18, 2017 at 2:27
  • $\begingroup$ Yes, GAs are a type of derivative-free method, and there are many others. How well any particular choice will work depends on the problem. I'd recommend checking out some review papers, like this one: Rios & Sahinidis 2013. Derivative-free optimization: a review of algorithms and comparison of software implementations. $\endgroup$
    – user20160
    Commented Jun 18, 2017 at 3:16
  • $\begingroup$ Can you please tell me your opinion on which ones you think are simplest/most practical in reality? $\endgroup$ Commented Jun 18, 2017 at 23:21

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.