Hi Jason, It looks like you are trying on a simple task just to get to know how NuPIC works. That's great! I can tell you what is not working and why.
This problem is a "first-order prediction" problem. That means that once you've established what the rules are, HTM can look at only one row of data and make a prediction. One does not need to see more than one row. This is similar to my cellular automata example [1]. NuPIC and HTM are not good at math. The way you have this set up currently is a math problem. Given a row of numeric input, the HTM must apply some logic and decide whether to increment or decrement an integer score. NuPIC will perform better when applied to string categories. So the first thing I did was change the input from integers to strings. I assume you're not that interested in predicting the score per se, but rather teaching HTM the rules of the game. So given the player state of one game, it should be able to "predict" the winner of the game once it has seen enough games and winners. I changed your code to do this without integers and scoring: https://github.com/jxieeducation/HTM_sequential_learner/pull/1/files In this configuration, NuPIC does indeed learn the rules of paper/rock/scissors in less than 100 iterations [2]. To run the new code, you'll need to regenerate data and swarm: cd rockpaperscissors python generate_data.py python swarm.py python run.py I hope this helps you understand how to use NuPIC. Please respond with any questions. [1] https://github.com/nupic-community/nupic.ca [2] https://gist.github.com/rhyolight/4742ed37d98a881866c5 Regards, --------- Matt Taylor OS Community Flag-Bearer Numenta On Sun, Dec 13, 2015 at 4:06 PM, Jason Xie <[email protected]> wrote: > Hey everyone, > > I have been trying to get Rock Paper Scissors to work. > src: > https://github.com/jxieeducation/HTM_sequential_learner/tree/master/rockpaperscissors > > My generated data uses this encoding: 0: "rock", 1: "paper", 2: "scissors" > An example generated data -> > scoreBeforeDuel: score before the current round from the player1's > perspective > player1, player2: 0, 1 or 2 according to the encoding > > player1,player2,scoreBeforeDuel > 0,1,0 #score starts at 0, rock loses to paper > 0,0,-1 #since rock loses to paper, score is now -1 > 2,2,-1 #tied last round > 2,1,-1 > 1,0,0 > > I am doing TemporalMultiStep for 1 step prediction. My logic is that given > score before a round, and the rock paper scissors hands, I should be able to > predict the score after the round. > > However, my predictions are not working at all > https://github.com/jxieeducation/HTM_sequential_learner/blob/master/rockpaperscissors/output.txt > > Thanks very much!
