2

I need to use reinforcement learning to teach a neural net a policy for a board game. I chose Q-learining as the specific alghoritm.

I'd like a neural net to have the following structure:

  1. layer - rows * cols + 1 neurons - input - values of consecutive fields on the board (0 for empty, 1 or 2 representing a player), action (natural number) in that state
  2. layer - (??) neurons - hidden
  3. layer - 1 neuron - output - value of action in given state (float)

My first idea was to begin with creating a map of states, actions and values, and then try to teach neural network. If the teaching process would not succeed I could increase the number of neurons and start over.

However, I quickly ran into performance problems. Firstly, I needed to switch from simple in-memory Python dict to a database (not enough RAM). Now the database seems to be a bottleneck (simply speaking there are so many possible states that the retrieval of actions' values is taking a noticeable amount of time). Calculations would take weeks.

I guess it would be possible to teach neural network on the fly, without the layer of a map in the middle. But how would I choose a right number of neurons on the hidden layer? How could I figure out that I'm loosing periously saved (learned) data?

Community
  • 1
  • 1
Luke
  • 1,369
  • 1
  • 13
  • 37
  • I think you should post this question on game dev stack. You'll get better game related answers there. – Sven van Zoelen Jan 05 '16 at 13:21
  • Possible duplicate of [Clarification on a Neural Net that plays Snake](http://stackoverflow.com/questions/42099814/clarification-on-a-neural-net-that-plays-snake) – devinbost Feb 15 '17 at 20:35
  • @devinbost it's like you're trying to get every question on neural networks closed and pointed at the one question you have answered. Are they really all duplicates? I have seen at least 15 so far... – tom redfern Feb 15 '17 at 21:12
  • @tomredfern they are all questions that I would give the same answer to. They're questions asked by individuals who really are primarily lacking understanding of the mechanics of neural networks, and I didn't know how else to help them because I got in trouble for giving people the link to my other answer and then got in trouble for copying relevant parts into each question. I was told to instead flag them as duplicate. Now you're saying I shouldn't do that either? – devinbost Feb 15 '17 at 23:14
  • @devinbost - No you shouldn't be doing that. I get that you have a stock answer which will help many people. This is a good thing, and I understand that your intentions are good also. However, flagging questions as duplicate which are clearly not duplicates is not the way to do this. Much better would be to post a comment with a link to the answer that the questioner can then follow. – tom redfern Feb 16 '17 at 09:01
  • 1
    @devinbost I can see how Martijn Pieters' advice was easy to misinterpret. However, he did say the following: *If the question is not a duplicate, tailor your answers to the question*. This is the key. Even though your answer might be helpful, it wasn't tailored to the question. On StackOverflow, each question which is not a duplicate expresses a unique cry for help, and demands of an answerer that the answer also be unique. You should not see this as overhead. Crafting an exact answer to a specific question is what StackOverflow is built on. – tom redfern Feb 16 '17 at 09:05

0 Answers0