Тёмный
No video :(

Selection - Writing your own Genetic Algorithm Part 2 

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

The second video in the series where we go over two techniques for selecting parents from a population while breeding offspring!
0:00 Introduction
0:50 Updated Repo & Changes
1:41 Selection Setup Code
3:31 Tournament Selection Explained
4:27 Implementing Tournament Selection
5:19 Uniqueness Lecture & Implementation
6:25 Biased Roulette Wheel Explained
9:27 Biased Roulette Wheel Implementation
11:43 Visualisation
12:10 Challenge Question & Outro
Links!
Visual Studio: visualstudio.microsoft.com/do...
Github: github.com/Gary-The-Cat/Selec...
Introduction Video: • Introduction to Geneti...
Pt. 1 Spawning: • Spawning - Writing you...
Join us on Discord:
/ discord
C# Notes:
Throughout this video, Linq is used quite heavily. Linq is a super convenient way to minimize code length and allows you to perform database-type operations on items that implement IEnumerable (like lists!). One example is:
(angle brackets omitted for ^ due to RU-vid)
var sum = Neighbours.Sum(n = n.GetFitness());
var proportions = Neighbours.Select(n = sum / n.GetFitness());
which is equivalent to
double sum = 0;
for(int i = 0; i ^ Neighbours.Count(); i++)
{
sum += Neighbours[i].GetFitness();
}
List^double^ proportions = new List^double^();
for(int i = 0; i ^ Neighbours.Count(); i++)
{
var neighbour = Neighbours[i];
proportions.Add(sum / neighbour.GetFitness());
}
Obviously, Linq's approach is much more succinct. Learn more here:
www.tutorialsteacher.com/linq...

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

 

12 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@danielkapferer9171
@danielkapferer9171 3 года назад
I usually do not comment on RU-vid videos, but this tutorial is so helpful for implementing a genetic algorithm, I just had to thank you!
@TutorialsWithGary
@TutorialsWithGary 3 года назад
Thanks Daniel, that means a lot :)
@SolvingOptimizationProblems
@SolvingOptimizationProblems 4 года назад
Very useful tutorial on genetic algorithm. Many engineering students will benefit from your video. Great job!
@TutorialsWithGary
@TutorialsWithGary 4 года назад
Glad you are enjoying the series, thank you for the kind words
@allankerridge4307
@allankerridge4307 4 года назад
These videos are really good. I'm learning a lot.
@TutorialsWithGary
@TutorialsWithGary 4 года назад
Glad it’s helping. GA’s are really malleable and are a good solution to a large number of problems. Hope you stay tuned for the rest of the series!
@user-lc1gi3er7e
@user-lc1gi3er7e 2 года назад
Thank you very much for this video!!!
@agentvx8320
@agentvx8320 4 года назад
Everything in BiasedRandomSelection() above the declaration of selectedValue should be getting run once per generation rather than for every individual. So you'd move the scope of cumulativeProportions outside the method (presumably to the parent class) and move the logic to another method to be called prior to selecting parents for a new generation.
@TutorialsWithGary
@TutorialsWithGary 4 года назад
I think you're spot on there, and should keep a close eye out for the next video!
@agentvx8320
@agentvx8320 4 года назад
@@TutorialsWithGary I will be!
@akashram1547
@akashram1547 9 месяцев назад
Really Amazing stuff. Why have you stopped uploading tho ? With this quality, the chances of you becoming a big channel is huge
@TutorialsWithGary
@TutorialsWithGary 9 месяцев назад
Hey, I really appreciate the feedback. I really enjoy making videos and want to make more but they are very time consuming & I’ve had some real life changes come up that are consuming more of my time now. I still plan to make more but will likely be moving onto other topics & concepts
@artemkopyl7060
@artemkopyl7060 Год назад
awesome tutorial man. just wanted to ask about one thing, why do we return the individual with higher fitness value in tournament selection? Shouldn’t we minimise the distance for next generations?
@TutorialsWithGary
@TutorialsWithGary Год назад
That is a very good question, that we will (shameless plug) cover in my multi objective video.
@gelding
@gelding 2 года назад
Great video, but you shouldn't name your parents as 'mother' or 'father', because I am assuming you are using genderless individuals. If you should you individuals with specific gender (male individuals for example would have different inner traits and so on) this naming convention would be proper.
@TutorialsWithGary
@TutorialsWithGary 2 года назад
That is a good point, I was honestly looking to introduce a gendered crossover at some point - but it would have been a better idea to refactor the name when I did. Thanks for the feedback
@gelding
@gelding 2 года назад
@@TutorialsWithGary very good tutorial for beginners though
Далее
If Barbie came to life! 💝
00:37
Просмотров 38 млн
Mutation - Writing your own Genetic Algorithm Part 4
17:36
13. Learning: Genetic Algorithms
47:16
Просмотров 520 тыс.
Can You Forge Tungsten?
16:14
Просмотров 535 тыс.
Spawning - Writing your own Genetic Algorithm Part 1
11:40
23. Multiobjective Optimization
1:07:25
Просмотров 44 тыс.