<p>It depends on what activation function you use.  With all standard activation functions, neural networks are continuous.  With ReLU activations (the most typical choice of activation function), they are piecewise differentiable.  The partial derivatives (the gradient) can be computed efficiently (using so-called "backpropagation"), and standard neural network frameworks will automate this process for you, as computing the derivative is part of how neural networks are trained.  Consequently, it is possible to use gradient descent methods to find <span class="math-container">$x$</span> that (approximately) minimizes <span class="math-container">$f(x)$</span>, when <span class="math-container">$f(x)$</span> is instantiated as a neural network.  <span class="math-container">$f(x)$</span> is not convex so you are not guaranteed to find the global minimum but for many problems this may be adequate; in others, you can adjust gradient descent (e.g., using random restarts) to mitigate those problems.</p>

CC BY-SA 4.0
2019-04-04T19:24:47.477Z
2019-04-04T19:24:47.477Z
D.W.
<p>I need to solve an optimization problem based on a function f(X). This function is not known, but it can be estimated from a training set. So first I train a model, then I get the score function f(X), and then I can use this function to solve my optimization problem.</p>

<p>So far, in my problem, I used a simple polynomial regression, and hence the score function is a polynomial. With this score function, the optimization problem works very well since it is infinitely derivable.</p>

<p>Now I want to improve f using a more complex model, i.e. a classic neural network for regression. I wonder: what kind of properties does the score function have in neural networks? Is it at least continuous? Is it derivable?</p>

<machine-learning>
Classic Neural Network Layout for regression: is the score function derivable?
edoedoedo
# Classic Neural Network Layout for regression: is the score function derivable?

(Asked by: username_0 on 2019-04-04)

I need to solve an optimization problem based on a function f(X). This function is not known, but it can be estimated from a training set. So first I train a model, then I get the score function f(X), and then I can use this function to solve my optimization problem.

So far, in my problem, I used a simple polynomial regression, and hence the score function is a polynomial. With this score function, the optimization problem works very well since it is infinitely derivable.

Now I want to improve f using a more complex model, i.e. a classic neural network for regression. I wonder: what kind of properties does the score function have in neural networks? Is it at least continuous? Is it derivable?

**Tags:** machine-learning


---

## 1 answers

### Answer by username_1 on 2019-04-04. Score: 1 | Accepted answer

It depends on what activation function you use. With all standard activation functions, neural networks are continuous. With ReLU activations (the most typical choice of activation function), they are piecewise differentiable. The partial derivatives (the gradient) can be computed efficiently (using so-called "backpropagation"), and standard neural network frameworks will automate this process for you, as computing the derivative is part of how neural networks are trained. Consequently, it is possible to use gradient descent methods to find $x$ that (approximately) minimizes $f(x)$, when $f(x)$ is instantiated as a neural network. $f(x)$ is not convex so you are not guaranteed to find the global minimum but for many problems this may be adequate; in others, you can adjust gradient descent (e.g., using random restarts) to mitigate those problems.


---

