kevin-fang / reinforced-flappy-bird

Using deep reinforcement learning and policy gradients to train a neural network to play flappy bird
https://www.youtube.com/watch?v=PNE6KFNn1yY
GNU General Public License v3.0
3 stars 0 forks source link

Help Understanding NUM_NEURAL_DIMS #3

Closed ryanmaxwell96 closed 4 years ago

ryanmaxwell96 commented 4 years ago

Hello,

Could someone please help me understand where NUM_NEURAL_DIMS is coming from? I tried to do a Google search as well as look through the folders and couldn't find it.

Thanks, Ryan

kevin-fang commented 4 years ago

It's been a while since I've looked at this code, but I believe NUM_NEURAL_DIMS is just the number of inputs from each training sample, as in the number of input neurons in the network.

ryanmaxwell96 commented 4 years ago

Wow, thank you so much for the fast reply. Actually I was first using Pytorch, but swapped to Tensorflow because I figured Tensorflow had a wider support network.

At any rate, I'm just trying to figure out where specifically is it getting defined or from which package so as to understand how the code is working better. It isn't hard to see how it is being used in the FlappyGraph function. But where is it coming from? It has to be random, sys, numpy, config, tensorflow, tf_graph, os or sklearn but I haven't found it. Plus, if you have any suggestions as to what other websites are helpful to get live support for newbies, that would be highly appreciated!

kevin-fang commented 4 years ago

The variable is being defined in config.py (https://github.com/kevin-fang/reinforced-flappy-bird/blob/master/FlappyBird/config.py).

I highly suggest reading Karpathy's blog post Deep Reinforcement Learning: Pong from Pixels, as it's where I got a lot of my inspiration and he explains it and the math behind it really well. He writes it in pure numpy, though, so it may be a little more difficult to understand.

ryanmaxwell96 commented 4 years ago

Ok well thanks again so much for the help! I don't want to ask too much, but do you think you will be available to help with understanding this code if I have any other questions in the code? And thanks for the suggestion about Karpathy's blog. I will be sure toe look it up.