Hacker News new | ask | show | jobs
by primaryobjects 4514 days ago
Neat. You could also probably do this with a genetic algorithm. Thinking out loud here:

- Have a neural network with 6 inputs for:

   - player x
   - player y
   - acceleration speed
   - acceleration direction
   - next pipe mid-point x
   - next pipe mid-point y
- Two outputs of 0 or 1 for click or no-click

The fitness score would be how close the player is to the pipe mid-point. Hopefully, this would cause the bird to stay as close as possible to fly between the pipes. The genetic algorithm would select the best neural network that knows when to flap based on the current input state.

2 comments

I'm curious, I've thought about using genetic algorithms for training neural nets before, but haven't seen it mentioned much. I imagine PSO could work as well. What is the general concensus on using algorithms other than back propagation for neural net learning? When is it appropriate / not appropriate?
Some people frown upon training neural networks with genetic algorithms, just because gen algs are so random and hard to dissect. I think it's silly to discard anything that is a potential solution to a problem.

I go by a rule of thumb like this:

- If you are able to collect lots of training data (inputs and valid outputs) then use back-propagation. It's faster and you might get better results.

- If you don't know the outputs for inputs or if there are simply too many possible combinations (such as in the case of a game), then use a genetic algorithm. It's effectively a search engine that finds the best solution within the problem space (the solution being the optimal weights for the neural network).

Using Neural Networks and Genetic Algorithms http://primaryobjects.com/CMS/Article105.aspx

is being in the middle of the pipes the ideal position most of the time?