Share your repls and programming experiences

← Back to all posts
Rock paper scissors, with self learning ai.
h
CoolestDoggo (35)

Credits to Cássio Zen for the neural network. (the only reason this works)
find the source here: http://gist.github.com/cassiozen/de0dff87eb7ed599b5d0

Type r for rock, p for paper, and s for scissors.
The ai will slowly learn how to win.

This really isn't that impressive because it knows what you chose but I just wanted to make something that can learn quickly and easily.

edit: I edited the code now so that when it loses it sees it as really bad. So this should make it learn better. (I guess like more of a punishment/reward)

Commentshotnewtop
MrEconomical (2225)

a neural network that isnt garbage

  • E
ColinDaniels (2)

First, I'd like to say that you did a really good job on this, second, of course you can use other people's code. The 'Talk' Section is meant to share code so others can use and build off of it as well as show off what you made

CoolestDoggo (35)

@ColinDaniels Thanks!
Also yeah, I kind of figured it was fine but I just wanted to make sure.

RayvelArjoon (87)

lol
I lost on the second go

InfInItel (1)

Lua? The first time I've ever seen someone use Lua except for Roblox.

Foster_Bryant (96)

how do i get into neural networks with python?

CoolestDoggo (35)

@Foster_Bryant
I only know the very basics of python but these seem like some good resources to look at:
https://towardsdatascience.com/how-to-build-your-own-neural-network-from-scratch-in-python-68998a08e4f6
https://stackabuse.com/creating-a-neural-network-from-scratch-in-python/

If you are looking to fully build a nn on your own I would recommend doing research on how they work if you haven't already.

Foster_Bryant (96)

@CoolestDoggo are neural networks similar to deep learning?

CoolestDoggo (35)

@Foster_Bryant Deep learning is someone that teaches itself with no human intervention.
This is what most big companies do for ai but this is just a simple one.
edit: For clarification, deep learning is made up of multiple neural networks that basically go against each other. They will start to learn better ways to do things from random mutations and changes.

Foster_Bryant (96)

@CoolestDoggo oh. how would I go about making a basic stock prediction neural network? just the concept

TurtleAndrew (62)

@Foster_Bryant try using "Tensor Flow" aka googles AI for python, works really good.

Foster_Bryant (96)

@TurtleAndrew ok ill look into it when I get out of school thanks

IreoluwaRaufu (196)

When I put in the same option, such as 'scissors' the AI doesn't learn that rock beats scissors. It just keeps putting down paper, and never learns. I think there's a problem here.

CoolestDoggo (35)

@IreoluwaRaufu It was set to learn "slower" to avoid mistakes in learning, I changed it so it should learn faster and be a bit smarter.

IreoluwaRaufu (196)

@CoolestDoggo Oh. OK. That makes sense. other than that, this is really impressive \(0.0)/

idonteatcats (7)

the ai just pick up on the input and matches it maybe make the ai pick the winning object and not the same object

CoolestDoggo (35)

@idonteatcats I dont control what it picks, it learns on its own from playing with you.