Deep Reinforcement Learning: Pong from Pixels
karpathy.github.io
karpathy.github.io
Many years ago, when I wanted to become a programmer and I didn't know anything about code, I used to fantasize and be amazed by programs. Code was like dark magic.
This is how I feel today about machine learning. Neural networks, liquid state machines. It's wonderful voodoo to my eyes.
I hope one day I get to work in that field, it seems so useful for solving big world problems. I have notice a definite rise in articles being written and shared on HN about it lately, that's great.
For those completely in the dark, I found this library to have great wiki pages about the basics of neural network programming. Great read, I recommend it. https://github.com/cazala/synaptic/wiki/Neural-Networks-101
A great introduction to the topic is the book Reinforcement Learning: An Introduction by Sutton & Barto. You can find the official HTML version of the 1st edition and a PDF of a recent draft of the 2nd ed. here: https://webdocs.cs.ualberta.ca/~sutton/book/the-book.html
My question is: Is it possible to eliminate that by further training? Naively you could drop 'stupid' inputs, but I assume that may also mess with the machine's understanding.
Further training may also reduce this, but technically, since the jitter is not causing any reduction in the reward, it might not. The best approach would likely be to alter the reward system to discourage jittery play...but again, there is no point because it does not reduce fitness.
I suppose where this is important is in robotics where jittery movement might actually be dangerous, or wear down hardware. In that case, you could certainly use an output smoothing function and tweak the reward.
But as the other people have commented, adding a small penalty on every move and giving it the option to stand still (along with some normalization?) might give a much smoother result.
The first part of the article definitely seems to give the impression that the choice is between UP or DOWN every frame.
But then a bit further on it was a bit more ambiguous and I could also interpret it as giving a probability for UP and a separate one for DOWN. Then it could also choose neither. But then it also could choose both, and you need a conflict resolution procedure (do neither, pick the one with highest probability, maybe just roll again?). Unless the actual game also has two buttons and you can just do whatever the game engine will do if you press both.
Another possibility might be to model the output a bit more like a human player would do it. First I'd change it into a series of timings + note-on/note-off commands (like MIDI), then perhaps add jitter to the timings (making sure the note-off doesn't jitter before the corresponding note-on). I've read that adding this kind of noise to a NN tends to improve its robustness, so that might help?
Most of those changes would happen as transformation step between the output layer and the simulation input, so I presume the learning algo itself can mostly stay the same. But there's probably a few snags to that as well.
https://www.youtube.com/watch?v=xOCurBYI_gY
Some games are played better than human would.
Maybe you could use the objective functions of Tom7 to determine which moves are good or bad in order to train a policy network?