Тёмный
No video :(

Crossover - Writing your own Genetic Algorithm Part 3 

Tutorials with Gary
Подписаться 3,9 тыс.
Просмотров 8 тыс.
50% 1

Check me out on Odysee for ad-free videos: odysee.com/@TutorialsByGary
The next video in the series where we go over one of the more complex parts of the Genetic Algorithm - Crossover!
The Crossover is a method of combining the genetic material of two parents - simulating the breeding that happens in nature. That means for the first time we will get to see our solutions improving over time!
Stay tuned, as the next video in the series will introduce the mutation operator.
0:00 Intro & Updates to Repo!
1:39 Speed Improvement Suggestion
2:24 Crossover Introduction
3:07 Crossover Code Setup
4:12 Crossover Explained
7:26 Crossover Code Implementation
11:18 Population Culling Explained
13:21 Visualization!
14:13 Challenge Question & Outro
Links!
Visual Studio: visualstudio.microsoft.com/do...
Github: github.com/Gary-The-Cat/Cross...
Join us on Discord:
/ discord
Introduction Video: • Introduction to Geneti...
Previous: Pt. 2 Selection: • Selection - Writing yo...
Crossover Video Assets: drive.google.com/open?id=1YaL...
Shared Assets: drive.google.com/open?id=1IPh...
Town Assets: drive.google.com/open?id=1QXs...

Опубликовано:

 

12 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 18   
@CodingJourney20
@CodingJourney20 Год назад
I'm learning GA so I can build a course scheduler for the computer science department in my school. I've read a lot of materials and I have questions mostly on the implementation aspect. This series has helped me get an answer to some of those questions at the same time making GA easy to understand and I'm not done with the series yet... thank you 🙂
@edinbrodlic4564
@edinbrodlic4564 3 года назад
What a great series, as well as a very enjoyable voice.
@TutorialsWithGary
@TutorialsWithGary 3 года назад
Thanks for the kind words, I don't think anyone has ever complimented my voice before haha :)
@svenkeysers4297
@svenkeysers4297 4 года назад
Thank you very much for producing this series :) Great quality work!
@TutorialsWithGary
@TutorialsWithGary 4 года назад
You’re welcome! Thanks for watching
@sagarpingale1997
@sagarpingale1997 2 года назад
This is the best GA tutorial on youtube I have seen so far..
@TutorialsWithGary
@TutorialsWithGary 2 года назад
Thanks, I appreciate that & am glad you found it helpful
@SolvingOptimizationProblems
@SolvingOptimizationProblems 3 года назад
Great explanation and code of crossover in genetic algorithm. Well done Gary!
@adammetcalf8954
@adammetcalf8954 4 года назад
I'm really enjoying this video series. It looks like you don't have a lot of feedback yet, so I just thought I would say thanks! I'm using this as an opportunity to learn how to get started with OOP in MATLAB. I have been programming for a while now in various languages, but I have never really mastered OOP yet. Its great to have a nice meaty project like this to practice with.
@TutorialsWithGary
@TutorialsWithGary 4 года назад
Hey thanks for the feedback! OOP can be a really tricky thing to get your head around to start with, but once you do, it feels as natural as breathing :) I'm glad you're enjoying the series
@adammetcalf8954
@adammetcalf8954 4 года назад
@@TutorialsWithGary Finished, all is working well. I learnt a great deal so thanks again. My main takeaways from this: 1. I should have been more modular in my approach to designing classes. I ended up with 4 or 5 classes which did everything. I think a better approach would have been to use more classes with fewer responsibilities each. 2. I didn't exploit inheritance, and I would do if I was to do this again. For example, I had an 'Individual' Class and a parent class, which had identical properties but different methods. I should have made the parent class a child of the individual class. 3. I ended up with lots of duplicated individuals in the population after a few generations which led to finding local minima rather than the global minimjm. My approach to overcoming this was inefficient, with nested loops replacing duplicates with a new individual. I guess this could be considered as a mutation, but it slowed down my solution a lot. 4. I built this specifically to solve a world with 10 cities. I had to do a good deal of redesigning to abstract this to solve n cities, which is due to poor planning at the start. again, thanks for this video series.
@TutorialsWithGary
@TutorialsWithGary 4 года назад
Wow that sounds like an incredible outcome, I love the drive. A lot of your takeaways are quite important, and are guaranteed to improve and just become more natural over time. The code I have been writing in this series could definitely be technically better - but it can make things less clear for people less familiar with the language following along. In my next video I'm going through the implementation of multi-objective, which I took as an opportunity to refactor a bunch of the code, and add a test project into the mix. If you're interested in looking over some improved quality code, I'd recommend giving it a look! github.com/Gary-The-Cat/MultiObjective
@arctan-k
@arctan-k Год назад
my guess is to iteratively go pairwise of two parents and randomly taking one element from each parent
@MattiKoopa
@MattiKoopa 3 года назад
I breed the individual town connections instead of splitting it somewhere random. So I first chose a random parent for the starting point (let's say town 2 was the first one in the sequence for father and was chosen), then another random parent for the new connection (say the mother had a connection from town 2 to town 6 and was chosen, so I used 6 next). If it's already in the genome or the prefered parent has this town at the end and thus no new connection, I chose the connection of the other parent. If both fail, I chose a random town not yet in the genome. I'm not sure if this is a better approach. Maybe? Also this way I only have 1 offspring per parent pair, which I don't know if it matters. My code will usually produce a stagnant result at around 110 generations for 30 random towns.
@TutorialsWithGary
@TutorialsWithGary 3 года назад
That’s an interesting approach. In terms of what is ‘better’ - it’s hard to say. But it’s good to think about it in terms of what the point of our crossover operator is - to take characteristics of our parents that make them genetically good, and pass those on to the children. For the implementation I talked through, randomly splitting gives the chance to take two separate good parts from both parents. How do you imagine your implement would do? I think both implementations would work - hard to say what is better without some testing.
@annapareddysatyanarayanare9013
@annapareddysatyanarayanare9013 2 года назад
How to combine two random solutions with crossover.? I am looking for suggestion...please
@TutorialsWithGary
@TutorialsWithGary 2 года назад
Hey, how are your solutions encoded & what are they representing ? The best crossover operator can be hard to choose.
@annapareddysatyanarayanare9013
@annapareddysatyanarayanare9013 2 года назад
@@TutorialsWithGary Here two randm solutions are for example A,B. By taking these two random solutions are combining with crossover to generate random solution C in genetic algorithm with TSP. I need help how can I implement. Please suggest me and can you give me email address
Далее
Mutation - Writing your own Genetic Algorithm Part 4
17:36
The Wave Function Collapse algorithm
21:45
Просмотров 279 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 890 тыс.
NEAT - Introduction
21:27
Просмотров 84 тыс.
Selection - Writing your own Genetic Algorithm Part 2
12:34