问题
I was told to implement a neural network to do forecasting. So I created a Feed Forward MultiLayer Perceptron with a Backpropagation algorithm and it is working fine. But I need to get results faster and faster. So I thaught about genetic algorithm t ooptimize the weights in the training session.
How do you suggest to encode the chromosme ?
I already done it as a table of weights generated randomly (-100, 100) but it's not giving extraordinary results. I guess that the problem is that generating a random table of weights limit the solutions space even if the probability of mutation is high.
Any idea how to encode the weights in the chromosme in order to let the genetic algorithm work great ?
Thanks in advance.
回答1:
In short (which has been already suggested in the comments): don't do this. Genetic algorithms are a simple metaoptimizers for problems which cannot be efficiently optimized, as they are slow, heuristic and require lots of resources. In particular they should never be sued to train a neural network, for which we have dozesns of very efficient training methods (SGD, Rmsprop, Adam). They can be used to optimize some more abstract parts though, like network architecture etc., where one cannot compute valid gradients or even use other well defined mathematical procedures.
回答2:
If you want to use any evolutionary algorithm to optimize neural network weights, May be better approach is Learning the network once using Back propagation then use the weights maximum and minimum for encoding limits. Lets say weights are distributed between -1.0988333,1.2982293, i would take [-2,2]/(-2,2) so that a chromosome can be generated between in this interval would be more inclined towards better solution and can be optimized further by algorithm. Interval of [-100,100] would be slow in generating optimal solution. Of course, how would you define your fitness function matters in getting optimal solution. One approach would be getting minimum rms value for given weights.
来源:https://stackoverflow.com/questions/38785019/weights-optimization-of-a-neural-network-using-genetic-algorithm