# How to find the best input value for this simple problem?

Suppose I have a neural network, with input variables $a, b, c, d, f, g$ and output variables$m, n, o, p, q$.

Given different input values, the neural network will output corresponding $m, n, o, p, q$.

Now I want find out the best input values which can maxmize $m, n$, while minimize $o,p,q$ with different weights as well. So how can I find the best $a, b, c, d, f, g$?

Currently I use a simple way, which calculate $x= w_1 m + w_2n+w_3 \frac{1}{o}+w_4 \frac{1}{p}+w_5 \frac{1}{q}$, then find the input to get maxmization of x. However this simple method assume $m, n, o, p, q$ are independent, which is not the case.

So how should I solve this problem?

Many thanks.

-
I think it may be a good idea to migrate it to Math.SE... –  mbq Feb 4 '11 at 18:11

Based on your question and the comments you have given to answers, I think there's a fundamental misunderstanding in your logic/problem formulation. In order to optimize something, no matter the method, you need to have something to optimize over.

In order to formulate a proper solution, you need to have a clear question. I suggest instead of fiddling with implementation of your NN, try to go back to your model (you should have one) and try to define the problem you want to optimize in more clear terms. Once you have the problem defined, then you can use the appropriate means to solve it.

It's of course possible that you have a function you want to optimize, and I misunderstood you question. I apologize if that's the case, but I believe in that scenario more detail, and a clear definition of the problem would certainly help your chances of getting help.

-

If we are talking about, for example, a neural network that is using back-propagation to learn, then a better way of thinking about this is that you are trying to set a,b,c,d,e using the neural network. Your fitness function is fine, but that would be what your neural network is optimizing (a single output). You don't select a,b,c,d,e, you use a method like back-propagation of errors to set these for you. That's normally the point of using the neural network (not having to solve for the a,b,c,d,e coefficients yourself).

If, on the other hand, you're really convinced you don't want to use the iterative approach, you might look at the method of Dr. Hu of Southern Illinios University (Carbondale), who developed a non-iterative approach that lets you directly solve for the neural network coefficients. Here's an article on it: article in 1996 Proceedings of World Congress on Neural Networks

Myself, I would use your fitness function as the (single) output you're training the network to optimize, and use back-propagation (supported by many open-source neural network simulations) to find the input coefficients. But Hu's approach (above) is workable if for some reason you don't want to use the iterative approach to find them.

-
To maximize $\sum w_i x_i$, simply set $w_i=\infty\cdot sign(x_i)$ or something comparable.