I'm evolving a population of neural networks and I've been struggling with normalizing fitness scores (to values in range 0 to 1), so that the number on its own is most meaningful. The issue is that agents are tested under different conditions - they participate in different games, and for each game a different fitness function is used. Fitness functions look more or less like this:

agentsFitness[indiv][0] += Util.mean(speed) * (games[0].getConstant(0) - Math.sqrt((Math.abs((speed[LEFT] - speed[RIGHT]))) * (games[0].getConstant(1) - Util.normalize(0, 4000, maxIRActivation))));

but each one will take different inputs. I can easily normalize numbers for each of them separately because I can estimate the maxima and minima of the input. Some of them will be in range of (-30,000, 360,000) and some (0, 900).

Part that I find difficult is that the agents may be tested on two, three or more games at the same time, so their fitness score will be a sum of the scores on all of the games. Additionally, new games can be introduced/evolved. Hard-coding normalization's min and max is not suitable here.

If I try to use very large max and min, I end up with a scores in a range (0.40, 0.45) for the games that have smaller input values which hides the underlying diversity of the scores.

Any suggestions on how these fitness scores could be normalized will be greatly appreciated.

有帮助吗?

解决方案

So you're trying to optimise a neural network using genetic algorithm, right? Cool!

It is usually advised to use normalised input to ANN, but this is particularly applicable when using sigmoid activation. Are you sure you need normalised data? Without knowing the range of your input, it is quite difficult to get the ANN to do its job.

  1. If you're hard pressed on normalising the input, keep track of the current maxima and minima in your data.
  2. Better still, try to iterate over the data once to gather apriori information about maxima and minima (only if it doesn't significantly add to the time complexity).
  3. Or else, try investigating a logic to guess the maxima and minima. Maybe... another neural network to do the guess work :). This will depend upon the environment.

What you're trying to do is not very clear to me... but from what I understand, these are the only suggestions I could come up with.

Check these two links. Might help:

Normalizing values with unknown bounds

Normalize components in a language model

其他提示

You could use the standard normalized scores: For each population (in this case each input collection) you can calculate the score of an individual by subtracting the population mean from it, and then dividing it by their standard deviation.

This does not leave you with numbers between 0 and 1 but does allow you to compare two populations with each other

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top