Live data from Hacker News

Show HN: Play rock paper and scissors against a untrained neural network

github.com

31–40 of 64 posts

Re: Show HN: Play rock paper and scissors against a untrained neural network

#32

I hate to say it, but I’m not sure it’s playing fair. I used random.org to play truly randomly, and the “neural network” beat me to 10 pts 6 times in a row.

Yeah, I am not sure what is going on, I just played it 1000 times from rand and the results were. 500 plays - Player: 144, Computer: 179, Tie: 177 https://youtu.be/g9Zo771HYpM 1000 plays - Player: 325, computer: 359, tie: 316 https://youtu.be/7pB5TZ_xYzE

I just did the same thing,

500 plays - Player: 163, Computer: 179, Tie: 158

1000 plays - Player: 306, Computer: 365, Tie: 329

I've run it several times and the computer has won every time against random, it must have an unfair advantage.

Re: Show HN: Play rock paper and scissors against a untrained neural network

#33

Earlier quoted context omitted.

But if it predicts you are playing random, is it not then random vs random? I am under the impression that you can't game random -- unless you are aware of the random generator being used is broken..

If you made random moves in a game of chess or checkers you'd get beat by a four year old with the barest grasp of the rules. In fact I would love to see a chess-playing robot that actually does that, it would thrill the crap out of my nephews to beat the big bad robot in a game of wits. I'm unaware of the name of the property that RPS exhibits that makes it ungameable by a random opponent (zero-sum?) but ordinary RP…

This is not chess. But a game of chance. You can't form a strategy based off random without predicting said random.

I thik it was already pointed out but I have not had a chance to verify. This game uses your played move in tht training set to train before making it's predictions.

Re: Show HN: Play rock paper and scissors against a untrained neural network

#34

Earlier quoted context omitted.

But if it predicts you are playing random, is it not then random vs random? I am under the impression that you can't game random -- unless you are aware of the random generator being used is broken..

If you made random moves in a game of chess or checkers you'd get beat by a four year old with the barest grasp of the rules. In fact I would love to see a chess-playing robot that actually does that, it would thrill the crap out of my nephews to beat the big bad robot in a game of wits. I'm unaware of the name of the property that RPS exhibits that makes it ungameable by a random opponent (zero-sum?) but ordinary RP…

Are you implying that you can (or any other human can) in the long run beat someone who is playing RPS randomly?

Re: Show HN: Play rock paper and scissors against a untrained neural network

#35
post #15

Earlier quoted context omitted.

after the player makes a move the nn makes ones and add it to it's training data. the move the player does after that is added as a counter move to the nn move. this way I treat the data as time series.

The problem is that that the player's move is actually being fed to the training data before the computer makes its prediction. Take a look at the variable 'y' after making your move and you'll see that it includes the player's last move. Because 'y' is updated before the computer makes its prediction, this shows that the computer uses the player's current move as part of the training set to decide its move.

I took a stab at fixing this: https://github.com/victorqribeiro/jokenpo/pull/3

Re: Show HN: Play rock paper and scissors against a untrained neural network

#36
I have "beaten" it. Play initially like you would - typically a human would change his choice often. The network would learn from you and gain a lead of say 10 points. After this, if you pick something that gives you a win start sticking to it while it gives you a win. You will quickly regain the lost points and gain a small lead. This seems to work every time I try it. After 60 moves I always lead a bit. Btw, the game gets slow then.

Not sure a bigram or trigram model would not do better than the neural network.

Re: Show HN: Play rock paper and scissors against a untrained neural network

#37

Earlier quoted context omitted.

If you made random moves in a game of chess or checkers you'd get beat by a four year old with the barest grasp of the rules. In fact I would love to see a chess-playing robot that actually does that, it would thrill the crap out of my nephews to beat the big bad robot in a game of wits. I'm unaware of the name of the property that RPS exhibits that makes it ungameable by a random opponent (zero-sum?) but ordinary RP…

This is not chess. But a game of chance. You can't form a strategy based off random without predicting said random. I thik it was already pointed out but I have not had a chance to verify. This game uses your played move in tht training set to train before making it's predictions.

RPS is not a game of chance. Outcomes of games are determined not by a random process, but by the choices of the players.

If the players rolled dice and biggest roll wins, that's a game of chance. The dice can't pick how they're thrown, nor can the throwers influence the outcome. If either of those two things change, the game is no longer purely one of chance.

The game can be set up in many ways that invite strategy. If they set up a camera and watched the human playing out the moves physically, that lets the algorithm read the person's patterns the way a human might read someone's poker tell.

Re: Show HN: Play rock paper and scissors against a untrained neural network

#38
post #34

Earlier quoted context omitted.

If you made random moves in a game of chess or checkers you'd get beat by a four year old with the barest grasp of the rules. In fact I would love to see a chess-playing robot that actually does that, it would thrill the crap out of my nephews to beat the big bad robot in a game of wits. I'm unaware of the name of the property that RPS exhibits that makes it ungameable by a random opponent (zero-sum?) but ordinary RP…

Are you implying that you can (or any other human can) in the long run beat someone who is playing RPS randomly?

Can I beat a computer playing randomly, no. A human, show me where the random number generator in their brain is.

Re: Show HN: Play rock paper and scissors against a untrained neural network

#39
post #16
post #15

Earlier quoted context omitted.

after the player makes a move the nn makes ones and add it to it's training data. the move the player does after that is added as a counter move to the nn move. this way I treat the data as time series.

I think it's fair, cause it's like the neural network is thinking "after I play rock the player plays paper" and train with that data

But that's not what you're coding. If you trained it with every possible next move and response then you would learn that kind of relationship (though you would also overfit on the existing moves), but this way you just give it a peek into the probability distribution of the players moves, one thats so accurate that it comes from the future...

Re: Show HN: Play rock paper and scissors against a untrained neural network

#40

Earlier quoted context omitted.

But if it predicts you are playing random, is it not then random vs random? I am under the impression that you can't game random -- unless you are aware of the random generator being used is broken..

If you made random moves in a game of chess or checkers you'd get beat by a four year old with the barest grasp of the rules. In fact I would love to see a chess-playing robot that actually does that, it would thrill the crap out of my nephews to beat the big bad robot in a game of wits. I'm unaware of the name of the property that RPS exhibits that makes it ungameable by a random opponent (zero-sum?) but ordinary RP…

2 person adversarial games with hidden information (eg poker or RPS) exhibit a "Nash equilibrium in mixed strategies". That is, the best strategy involves a random selection between choices with some probability weights. Since RPS is a very simple game, the weights are equal, so the unbeatable strategy is to choose between rock, paper and scissors with uniform probability on each round taking no account of what you or the other player have played before. Any other strategy can be exploited to the extent it deviates from pure uniform random choice (eg trivially the classic "play the thing that would have beat the thing which beat the winner of the previous round" strategy in RPS which you can use to reliably destroy children at the game).

Games with complete information (eg noughts and crosses, chess, go etc) have "pure strategies" (ie randomness is not required and there should always be an absolute best move in any given situation which you should pick 100% of the time).

Here's an intro to the concept of Nash equilibrium in mixed strategies http://www.econport.org/content/handbook/gametheory/useful/e...

Edit: In case it's not clear, the hidden information in RPS is the opponent's move. Whereas in chess you are either starting the game or you know what the opponent has done, in RPS you move simultaneously with the opponent, so don't know their move.

Post reply on HN