1

I have problem to be solved and any constructive help would be good.

Anyway, I have to make genetic algorithm that creates neural network for solving problem Ball-and-Beam. Only fitness function that I imagine is to set some time (like 3 - 10 seconds) and test each unit in population if it will survive on board (fitness = t/T ; t - time it survived, T - total time), that takes TO LONG :(.

Simulation look like this

That genetic algorithm should generate weights, coefficient of training and number of neurons for each hidden layer. Mostly I have done rest of the things but fitness is my biggest problem.

Thanks for help !

1
  • What is your goal? To control the ball to a specified position? Just express the fitness as a distance from the goal. What simulation tool do you use that it takes so long?
    – zegkljan
    Commented May 15, 2016 at 22:08

1 Answer 1

0

I think you're in the right way with "set some time and test each unit in population if it will survive on board".

I did something similar with a "bridge builder genetic algorithm" and my fitness function in that case were "build the bridge, put a car to pass it. The distance and time made by car were the fitness result". To evaluate this kind of fitness function takes a long time, so you can try to somethings to make it faster:

  • Parallelism: I imagine that your GA supports evaluate chromosome's fitness in parallel, if it supports you can put as many as possible ball-and-beam simulations to run in same time. In the case of bridge builder fitness funciton, I had about 100 bridges tested at same time.
  • Physics engine's time scale: if you're using a physics engine to perform your simulation, probably you can change it's time scale. Try to change time scale to 0.5 or less. The results may not be perfect as in normal time scale, but can be acceptable to create your neural network.

I don't know what language you are using to build your genetic algoritm, if you are using C# you can try to use GeneticSharp. I used it to create that bridge builder genetic algorithm with parallel fitness function evaluation.

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.