Before coming to the question, I'd like to mention that I've been reading through some basic articles about machine learning and watched some tutorials on the net. With that said; my knowledge is very limited in the subject.

Most examples I've seen (in code) often has datasets that contains the desired output of certain data, this in order to train and test.

What I'd like to try - or see by code example at least - would be an example of a neural network getting trained and tested by its achieved scores, instead of the desired output to be the exactly expected.

What I mean with trained by achieved scores would for instance be that the machine has three options: Stand still, Walk right, Jump. So instead of training the machine exactly when to stand still, walk or jump, it is trained by how many points it gets. I.e the more you walk and jump, the more points you might get according to the situation (i,e if you don't jump, a monster kills you). So, the more score you get the better.

How do you train a neural network by high scores instead of the exact desired output in a situation?

P.S: This video is pretty similar of what I am trying to explain, but I'd like it more easier than a game like this.

Also, if you could add examples in code (python would be preferable if possible), that is highly appreciated.


What you are looking for is called 'reinforcement learning'. Searching on google etc for 'reinforcement learning' will yield a ton.

Some good introductions:

Well, you know what, Karpathy's posts, together with the search terms 'reinforcement learning' are enough to get you started I reckon :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.