Live data from Hacker News

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

github.com

21–30 of 64 posts

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

#21

Earlier quoted context omitted.

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

How are you emulating the clicking?

This runs it randomly 1000 times (well not reaaally randomly, but it gets close), just paste it into the browser console:

const times = 1000;

function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }

async function run() { for (let i = 0; i run();

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

#23
post #14
post #13

Earlier quoted context omitted.

That sounds like the gambler’s fallacy. Less runs than what? Most truly random input haa far more runs than what people “think” is random, and in fact that’s one of the statistical tests for whether a data set was random. You’re essentially saying that a good neural network can predict the next value of a good random number generator. Good luck with that one! Maybe while you’re at it, have neural networks invert cryp…

Here’s what I’m thinking: The neural network doesn’t have to be correct about which one you pick, it has to be correct about which you don’t pick. Only one option they pick is a loss, so if the other party can be somewhat certain you won’t pick a specific option, it can at least tie. So if a randomizer has pretty even distribution, I think it can win more than half the time, because it can gather roughly how likely t…

Here's a thought experiment that might help: imagine what you say is truly the case - that would mean you could "charge up" a dice by rolling it until you got a long run of a given number - lets pick something arbitrary, say you roll until you get 5 twos in a row. According to what you've said the chance of the next number rolled being a two is now lower than it was when you started "charging up" your dice.

How is this possible? Nothing is physically changing about the dice between rolls.

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

#24

Earlier quoted context omitted.

How are you emulating the clicking?

This runs it randomly 1000 times (well not reaaally randomly, but it gets close), just paste it into the browser console: const times = 1000; function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function run() { for (let i = 0; i run();

You can also do:

for(i=0; iRight in the JavaScript console.

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

#25

Earlier quoted context omitted.

This runs it randomly 1000 times (well not reaaally randomly, but it gets close), just paste it into the browser console: const times = 1000; function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function run() { for (let i = 0; i run();

You can also do: for(i=0; i Right in the JavaScript console.

Nice! Thanks, I've edited my post to use this shorter version. The sleep is needed to avoid freezing the tab.

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

#26

I wonder about an arms race between two advanced AI’s which play RPS. I can’t fully put my head around this, but what would it be like if each AI could read the architecture of the other’s brain before each move. The AI’s would be permitted to reconfigure themselves as they play. An “obvious” strategy may be to simulate your opponent and ask what they are likely to play. Though, simulating their behavior is likely to…

don't you just end up with a (discrete) uniform distribution on both sides? anything else can be exploited by the opponent

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

#27
post #15

Earlier quoted context omitted.

Looking at the source code, the move you are about to make is included in the training dataset. This can be confirmed by playing “scissors scissors scissors rock” and then looking at the variables x and y in the console, which will include the surprise rock. The code updates x and y, then trains the model, and then makes a prediction. “Fair” code would make a prediction, then update x and y and train the model This e…

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.

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

#28
post #10

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.

The thing is, if you are playing randomly, that makes it easier to predict what you’re (not) going to do next. A good random distribution would give fewer runs, which means your choice is less likely to be the last choice you picked and somewhat less likely to be other recent values. It can at least tie by choosing scissors if it thinks you will not pick rock. This is kind of a shot in the dark because I am not famil…

Random specifically doesn't mean it's less likely to be the last choice you picked. At least if we're talking uniform random which we should be here. It means the last choice you picked is exactly as likely as any other choice.

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

#29
post #10

Earlier quoted context omitted.

The thing is, if you are playing randomly, that makes it easier to predict what you’re (not) going to do next. A good random distribution would give fewer runs, which means your choice is less likely to be the last choice you picked and somewhat less likely to be other recent values. It can at least tie by choosing scissors if it thinks you will not pick rock. This is kind of a shot in the dark because I am not famil…

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 RPS played by humans certainly doesn't exhibit it, only in the magic world of computers where things like simultaneity of play can be guaranteed does RPS exhibit that property.

If played in the real world like real humans traditionally played it, ongoing RPS matches between a human and an AI would soon see the AI dominating. I'd be very curious to see what real-world RPS would look like between two AIs that can 'explain their model'.

Imagine making a rule that gives a Xms window for making plays. Then strategy can start to emerge.

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

#30
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.

If true, this seems like it would be a huge scandal. Or at least an issue in Github.
Post reply on HN