in ,

victorqribeiro / bangBangML, Hacker News

victorqribeiro / bangBangML, Hacker News


                    

        

Watch a Neural Network learns how to shoot a target.

screenshot

Live version

Watch the video of the Neural Network learning ~ minutes

************************

Halfway through creating a clone of the classic windows game

Bang Bang

I realized I need a interesting Artificial Intelligence to play against the player. So I thought about having the opponent cannon be controlled by a Neural Network and learn how to shoot during run time.

Training

I came up with this algorithm to train the Neural Network.

1 – Shoot it at random

2 – If the shot was to the left of the target, adjust the weights to the right and vice and versa. On this step I’m not saving the training data, as I don’t care for a miss shot.

3 – After a hit, collect the data and use it to further train the Neural Network. This data is stored as it is a good example of how to shoot a target.

I’m thinking about using different iterations of the trained Neural Network to use as a difficult level. Neural Networks trained for a short while would be the first opponents while the Neural Network that ware trained for a long period of time would come last, as a more hard opponent.

**********************

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Silent Hill Remake Rumors Swirl After Artist Posts Cryptic Tweet, Crypto Coins News

Silent Hill Remake Rumors Swirl After Artist Posts Cryptic Tweet, Crypto Coins News

Guide to Web Authentication, Hacker News

Guide to Web Authentication, Hacker News