Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use use? #3

Open
TheOnlyPixels opened this issue Feb 18, 2018 · 13 comments
Open

How to use use? #3

TheOnlyPixels opened this issue Feb 18, 2018 · 13 comments

Comments

@TheOnlyPixels
Copy link

How do I train the snakes in 0-4? They always do the same moves and die at almost the same spots. It doesn't seem like they're learning anything.

@DerAchmet
Copy link

i dont know either somebody pls explain

@human-0
Copy link

human-0 commented Feb 26, 2018

@Trikos
Copy link

Trikos commented Aug 25, 2018

Hi, I tried this code and rewrite the Genetic Algorithm and also Fitness function, but my snake still nedd at least 100 Gen to avoid 1 or 2 wall in a row and eat 1 apple then other 200+ gen to do other super simple movement!
Somebody can help me? Maybe @Code-Bullet!
I saw different times your first video on youtube and Im 100% sure that you dont use this code!
Hope in a reply with further instruction, or maybe in an commit that modify all the stuff :D Thank you pals

@Xenossolitarius
Copy link

I ve also made my own neural net and made some tweaks to his code but all in all its working (more or less). The issue is you need to get lucky with a random seed. While I was testing his setup i noticed that if you don't get the fitness/score as he did in the video you can just stop the training. But if you get "lucky" which happens actually alot you will see the same results as him. Sooo just keep restarting the 100 generations until you see like 11 or 12 apples eaten. Hope this helps :D Btw. you should try implementing elitism ( about 10%) because I 've noticed it is helping alot with the results in combination with higher 5% mutation rate.

@Trikos
Copy link

Trikos commented Aug 31, 2018

@Xenossolitarius Hey, thanks for reply! Anyway I dont know what is elitism but im saure that a 5% mutation rate is a bit high.
Anyway can you post your code here on github or just send it to me?
Really appreciate

@Xenossolitarius
Copy link

Xenossolitarius commented Sep 1, 2018

@Trikos Actually I would be glad to help 👍 because it took me ages with the same problem. I can send code to you, no problem. It works for me with no changes but yesterday at 2 am I wrote a much better fitness function. Where can I send you the code ? ( C#)

@Trikos
Copy link

Trikos commented Sep 1, 2018

Can you publish it on your profile???

@Xenossolitarius
Copy link

nah I will keep it to my self but ill give you the changes and directions here: https://pastebin.com/MEchCRUS

@Trikos
Copy link

Trikos commented Sep 2, 2018

Man appreciate your help but I get some part of your code not working cause I cant see the other code!
SnakePart stop the executation!
I think you mean a PVector with SnakePart

@SparshaSaha
Copy link

Hi, I tried this code and rewrite the Genetic Algorithm and also Fitness function, but my snake still nedd at least 100 Gen to avoid 1 or 2 wall in a row and eat 1 apple then other 200+ gen to do other super simple movement!
Somebody can help me? Maybe @Code-Bullet!
I saw different times your first video on youtube and Im 100% sure that you dont use this code!
Hope in a reply with further instruction, or maybe in an commit that modify all the stuff :D Thank you pals

@Trikos , buddy why don't you use python where a prebuilt Neuro Evolution of Augmented Topologies (NEAT) library is availiable and you don't have to ge into the details of writing all the mutation and crossover stuff by yourself.
I have used it and it pretty much works cool.. You can find more information regarding NEAT here: https://neat-python.readthedocs.io/en/latest/

You can find the game-AI that i have made using NEAT here:
https://github.com/SparshaSaha/Self-Playing-AI-Bot-using-Evolutionary-Algorithms

@Trikos
Copy link

Trikos commented Sep 14, 2018

Well, currently I have no info about NEAT but instead I study the Q-Learning which is really bad for Snake, taking a life to learn how to play cause of Fitness function and the super space of solution!
Or maybe Im not doing it well (more probably).
Im not a Python program and I never used it yet so I will have some struggle to understand Python Syntax then the Algorithm, but I will take a look and try to implement it!
Thank you for suggestion and the code mate!

@SparshaSaha
Copy link

@Trikos I think you're gonna find that learning python is pretty much the easiest job on the planet.. And i'm pretty sure that you're gonna love python.. Anyway.. Good luck!! :)

@Vortetty
Copy link

Vortetty commented Jun 1, 2019

@Trikos I think you're gonna find that learning python is pretty much the easiest job on the planet.. And i'm pretty sure that you're gonna love python.. Anyway.. Good luck!! :)

it is one of the best beginner languages, very versatile too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants