Training a Neural Network using Genetic Algorithm

  Рет қаралды 56,244

Pezzza's Work

Pezzza's Work

Күн бұрын

Пікірлер
@programmingsoftwaredesign7887
@programmingsoftwaredesign7887 3 жыл бұрын
The nodes jumping prior to the hole are the type of people that do a 360 before they kill you.
@dingalong14
@dingalong14 2 жыл бұрын
Wish I got a "good job buddy" when I lasted 2.94 seconds.
@funduk89
@funduk89 3 жыл бұрын
Your videos will become very popular soon. I am sure. Keep the great work!
@Djellowman
@Djellowman Жыл бұрын
Love your videos! These are my favorite kinds of projects. I've made a pong clone that i want to try a genetic algorithm for, using a neural network package i've written in numpy
@aliyutube
@aliyutube 3 жыл бұрын
I wanna learn more.
@Juni_0220
@Juni_0220 2 жыл бұрын
Generation 3 will always have a place in my heart
@numero7mojeangering
@numero7mojeangering 2 жыл бұрын
Because your neural network have two inputs and one input, have you tried to plot it to a texture?
@PezzzasWork
@PezzzasWork 2 жыл бұрын
I haven’t tried but that an very nice idea! I will test it
@dezm0n679
@dezm0n679 3 жыл бұрын
Very cool sim, can i ask few questions? 1. How often NN fetch data from game? (Every frame/every 0.01 sec?) 2. How NN fetch data from game? Or its just implemented in game code? Thanks
@PezzzasWork
@PezzzasWork 3 жыл бұрын
Thanks! 1. The data is fetched every frame (in this case it was at 144Hz) 2. NN inputs are provided in game code since it's fully homemade
@BeneathTheBrightSky
@BeneathTheBrightSky 2 жыл бұрын
Gen three got really good really fast. I'm surprised!
@ВсеволодВласов-д7ж
@ВсеволодВласов-д7ж 3 жыл бұрын
Wow, thats amazing! Can you publish code on github?
@PezzzasWork
@PezzzasWork 3 жыл бұрын
I will publish it soon
@ashvinbhuttoo
@ashvinbhuttoo 3 жыл бұрын
@@PezzzasWork cant wait :D
@Ab-cj6gl
@Ab-cj6gl 3 жыл бұрын
@@PezzzasWork yeah me too i would love to see your code I'm building a neural network with JS and i just started coding few days ago lol
@superposition2644
@superposition2644 3 жыл бұрын
@@Ab-cj6gl I am also building a neural network, but it's my first one ever and I've already been coding for years and it still isn't working after days of work. It's training as I write this message, and hopefully when it's done it will finally work.
@Ab-cj6gl
@Ab-cj6gl 3 жыл бұрын
@@superposition2644 awesome! I'm building sort of a program that generates neural network for me up to this point I'm able to pass in how many number of input + hidden + output layers i just need to figure out how to pass values between layers i figured the first hafl from input layer to the hidden layers but I'm still not sure how to do it between hidden layers in case i had multiple
@teenspirit1
@teenspirit1 3 жыл бұрын
This is wonderful thanks for sharing. Have you tried augmenting topologies?
@revimfadli4666
@revimfadli4666 Жыл бұрын
Or evolution strategies with dense/cascaded net?
@SolvingOptimizationProblems
@SolvingOptimizationProblems 4 жыл бұрын
Very cool simulation. Is that in C or python? Thanks
@PezzzasWork
@PezzzasWork 4 жыл бұрын
Thanks ! It is written in c++ :)
@SolvingOptimizationProblems
@SolvingOptimizationProblems 4 жыл бұрын
@@PezzzasWork ah, OK, thank you very much
@npr1m991
@npr1m991 2 жыл бұрын
Please what is the output of the neural network ? Do they make a prediction for each frame ?
@Eren_Yeager_is_the_GOAT
@Eren_Yeager_is_the_GOAT Жыл бұрын
the output is to make the ball jump
@GodvenG
@GodvenG Ай бұрын
Ok but how they capable of "viewing the map" because im pretty sure the is way for indivuals to obtain some sort of information about next wall instead of just relaying on pure timings
@pradyumnagupta3989
@pradyumnagupta3989 3 жыл бұрын
What is the search space for the network's parameters? ....by which I mean what is the range from which parameters are initialized and mutations are applied.
@szymoniak75
@szymoniak75 3 жыл бұрын
Weights, biases would be my guess.
@psyneur9182
@psyneur9182 3 жыл бұрын
Assuming fully connected layers and each connection has a weight and bias float, there are 80 parameters to optimize. This is relatively small number - deep neural networks can have millions or billions of parameters. I couldn't find the source for this specific project, but for another one of his NN projects, he initializes all the parameters between -1.0f and 1.0f. The crossover between 2 networks does not introduce new values, and mutate limits values between -10.0f and 10.0f. So the search space for this project is likely [-10, 10] on 80 floats.
@teenspirit1
@teenspirit1 3 жыл бұрын
This is genetic algorithm, not grid search.
@t.swaggit629
@t.swaggit629 3 жыл бұрын
Very cool! Have you tried doing the same thing using gradient descent (the typical approach) instead of genetic algorithms?
@karanbirsingh1559
@karanbirsingh1559 2 жыл бұрын
There is no gradient information here
@revimfadli4666
@revimfadli4666 Жыл бұрын
@@karanbirsingh1559 there could be, if you setup a reinforcement learning framework
@ForTheOmnissiah
@ForTheOmnissiah Жыл бұрын
What activation function was used in each neuron? Sigmoid?
@Andy-vp7vl
@Andy-vp7vl 3 жыл бұрын
How do you do to make all neurals networks without lagging? Just two of them diminish my frame rate frop 60 to 30
@BlueSky-fj7yi
@BlueSky-fj7yi 2 жыл бұрын
Just code a basic one yourself. I get 250 population 60 fps without lag with an old pc.
@emmettdja
@emmettdja 3 жыл бұрын
Do you pass in the positions of the walls?
@PezzzasWork
@PezzzasWork 3 жыл бұрын
Just the delta x and y to the closest gate
@emmettdja
@emmettdja 3 жыл бұрын
@@PezzzasWork yea
@johnlemon8268
@johnlemon8268 4 жыл бұрын
How do you combine the weights from two specimens to produce a new one?
@PezzzasWork
@PezzzasWork 4 жыл бұрын
It's just a basic crossover, nothing amazing here :D
@johnlemon8268
@johnlemon8268 4 жыл бұрын
@@PezzzasWork So you have two arrays of weights and you just crossover the weights directly? Madlad.
@PezzzasWork
@PezzzasWork 4 жыл бұрын
@@johnlemon8268 yes exactly, it's quite brutal and I am working on better ways to do so :)
@depatrify
@depatrify 3 жыл бұрын
@@PezzzasWork Have you considered using CMAES?
@vast634
@vast634 4 жыл бұрын
Whats your cost function? Do you evaluate the number of jump-commands as a cost? (expending more energy)
@PezzzasWork
@PezzzasWork 4 жыл бұрын
Currently the cost function is just the distance traveled. Since jumps provide a quite big impulse they can't spam it too much or they would just crash on the walls
@vast634
@vast634 4 жыл бұрын
@@PezzzasWork Any plans for a more complex environment? Like a mario type sidescroller, with actions like jump and forward-movement, and random platforms. Once input could be the distance to the end of the current platform, and two for the height and distance of the next.
@PezzzasWork
@PezzzasWork 4 жыл бұрын
That could be fun, you gave me an idea! I will try to develop a little framework to do this :)
@vast634
@vast634 4 жыл бұрын
@@PezzzasWork You could also make an adversarial scenario, like in a simple shooter game. Where there are two teams, that try to shoot the other team. Agents can move, rotate and shoot. The sensors are distance to a wall/object, distance and color to an agent that is in front. Own team color. Reload-time for the next projectile. Own remaining "health". It would be interesting to see if they can develop some kind of strategy or optimal pattern to find and shoot at enemies.
@vast634
@vast634 4 жыл бұрын
@@PezzzasWork Also a good trick, if you get stuck in a local mimimum, is to reduce the mutation rate (and amount) over time. For example if the performance improvement of the best agent plateaus.
@vcom2327
@vcom2327 Жыл бұрын
Funny, I wrote an algorithm using genetic algorithms to optimze a Neural Network 35 years ago... I believe I was the first to do so.
@chinglebingle8243
@chinglebingle8243 8 күн бұрын
God? Is that you?
@sunday-thequant8477
@sunday-thequant8477 3 жыл бұрын
What framework/ library you use to the graphics? Nice work!
@PezzzasWork
@PezzzasWork 3 жыл бұрын
I am using SFML www.sfml-dev.org/
@sunday-thequant8477
@sunday-thequant8477 3 жыл бұрын
Thanks my bro
@sunday-thequant8477
@sunday-thequant8477 3 жыл бұрын
I love your work 100% respect. I'm doing something similar for trading training agents and i'm using python. But i'm training the agents in all the market data and is very slow... Thats why i decides come back to c++ Btw, You know how to use mongo db on c++?
@eldattackkrossa9886
@eldattackkrossa9886 3 жыл бұрын
@@sunday-thequant8477 there are accelerators for python, check out numba and tensorflow!
@sunday-thequant8477
@sunday-thequant8477 3 жыл бұрын
@@eldattackkrossa9886 yes, not enough faster :D
@rverm1000
@rverm1000 Жыл бұрын
can you do one in python?
@darkfrei2
@darkfrei2 3 жыл бұрын
Which activation function are you using for?
@PezzzasWork
@PezzzasWork 3 жыл бұрын
It's a sigmoid
@darkfrei2
@darkfrei2 3 жыл бұрын
@@PezzzasWork the logistic one?
@FredoCorleone
@FredoCorleone 2 жыл бұрын
Why does everyone solve this with Genetic Algorithms and not Gradient Descent?
@PezzzasWork
@PezzzasWork 2 жыл бұрын
Because it’s much simpler :)
@revimfadli4666
@revimfadli4666 Жыл бұрын
@@PezzzasWork agreed, though I find evolution strategies to be just as simple, despite being kind of a hybrid of GA and SGD
Жыл бұрын
2:24 this is the albert einstein
@vagishyagnik
@vagishyagnik 4 жыл бұрын
awesome
@jonathankiendrebeogo6523
@jonathankiendrebeogo6523 3 жыл бұрын
🤩🤩🤩🤩Wahouuuu 🤩🤩🤩🤩🤩🤩
@s1mo
@s1mo 2 жыл бұрын
When gen3 is better than me lol
@sedevacantist1
@sedevacantist1 2 жыл бұрын
This is so misleading; “training” “Neural network” “Genetic algorithm” the only thing being trained is the human programmer. There is no neural network, it's just a computer program. A genetic algorithm doesn't exist, it's just an algorithm (program). This is a flawed technology in that it attempts to mimic a brain by an assumed configuration that can produce inherent logic on its own. The human brain has a hardware system and a programmer all in one package. The delusion in this computer programing technique is that it can be designed to have intelligence even in the most rudimentary sense. This is a strong delusion; that with the right program a computer can make a logical decision that it was not programmed to make.
@25bever
@25bever 2 жыл бұрын
you're arguing semantics. real life is exactly like that; so calling this 'genetic' really is pretty accurate. You're right that in the end entities are programmed to do certain things, the thing is: human beings are no different.
@sedevacantist1
@sedevacantist1 2 жыл бұрын
@@25beverI respect your opinion on the use of the word genetics, and give it the most generous interpretation as an opinion, but genetics referrers to genes, what in a commuter is similar to a gene? My position is that intelligence is metaphysical and your claim is that it is mechanical. The materialist believes that an arrangement of logic circuits can produce intelligence, yet they must tell the circuits to open and close with a program. They claim the neural arrangement in the brain is the producer of intelligence, but that just can’t be true. A commuter is a box of switches and none turn on or off on their own, they must be programmed by an intelligence.
@revimfadli4666
@revimfadli4666 Жыл бұрын
So by your logic aren't you also misleading since the computer program you said doesn't even exist, it's just a bunch of voltages and electrons which themselves don't exist, it's just a bunch of quantum waves and so on?
@revimfadli4666
@revimfadli4666 Жыл бұрын
So what or who is the programmer of human brain? How were neural nets programmed to do stuff? By the programmer manually setting each weight?
@sedevacantist1
@sedevacantist1 Жыл бұрын
@@revimfadli4666 I don’t know exactly what you are asking. A computer is a box of switches that are turned off or on according to a program. These neural network videos make it seem as if someone is making a computer with a reconfigured CPU that resembles a human brain, a completely new type of computer. I believe it is just another program running on a regular PC and that it is less efficient and less accurate. I believe the brain and mind are separate things and the mind uses the brain, if it is operating correctly.
@BearJew840
@BearJew840 3 жыл бұрын
I can do better
@yosuanicolaus
@yosuanicolaus 2 жыл бұрын
lol ...
@EpicVideoGamer7771
@EpicVideoGamer7771 Жыл бұрын
Prove it.
@grayphantom100
@grayphantom100 9 ай бұрын
its useless , change the level and your training is absolete. i dont get ppl are impressed with these crap click baits
@PezzzasWork
@PezzzasWork 9 ай бұрын
If you watch closely you’ll see that the map is different each iteration
@blubaylon
@blubaylon 3 ай бұрын
🤣🤣🤣
Snake learns with NEUROEVOLUTION (implementing NEAT from scratch in C++)
28:08
Training a Neural Network to operate drones using Genetic Algorithm
8:54
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
The Knapsack Problem & Genetic Algorithms - Computerphile
12:13
Computerphile
Рет қаралды 239 М.
Data Mining Candlestick Patterns With a Genetic Algorithm
14:21
neurotrader
Рет қаралды 14 М.
But what is a neural network? | Deep learning chapter 1
18:40
3Blue1Brown
Рет қаралды 18 МЛН
Genetic Algorithms Explained By Example
11:52
Kie Codes
Рет қаралды 357 М.
Creating a Brick Breaker with my PHYSICS ENGINE
7:21
Pezzza's Work
Рет қаралды 111 М.
Evolving Genetic Neural Network Optimizes Poly Bridge Problems
9:59
NEAT Algorithm Visually Explained
18:07
David Schäfer
Рет қаралды 8 М.
Reinforcement Learning - My Algorithm vs State of the Art
19:32
Pezzza's Work
Рет қаралды 153 М.
How to Create a Neural Network (and Train it to Identify Doodles)
54:51
Sebastian Lague
Рет қаралды 1,9 МЛН
NEAT - Introduction
21:27
Finn Eggers
Рет қаралды 85 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.