Перейти к содержимому

9.8: Weighted Selection (for Genetic Algorithms) - The Nature of Code

The Coding Train

0:00 / 0:00

9.8: Weighted Selection (for Genetic Algorithms) - The Nature of Code

54 980 просмотров · 9 лет назад
The Coding Train
1,76 млн подписчиков
54 980 просмотров · 9 лет назад
In this video, I look at yet another technique for "pool selection" -- how to pick an item randomly from an array with a non-uniform distribution, i.e. some elements have higher probability of being picked than others. I use this same method in my Traveling Salesperson coding challenge, but it can be applied more broadly. Code: https://thecodingtrain.com/tracks/the... 🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s... 🎥 Previous:    • 9.7: Genetic Algorithm: Pool Selection - T...   🎥 Next:    • 9.9: Genetic Algorithm: Interactive Select...   🎥 All:    • The Nature of Code   References: 🔗 Nature of Code: https://nature-of-code-2nd-edition.ne... 🔗 Even Better GA Selection Pool Algorithm: https://github.com/CodingTrain/Sugges... 🔗 Genetic Algorithm: Random Pool Selection: https://github.com/CodingTrain/Sugges... Related Coding Challenges: 🚂    • Coding Challenge 35: Traveling Salesperson   🚂    • Coding Challenge 95: Approximating the Val...   Timestamps: 0:00 Hello 5:52 Explain improved algorithm 7:20 Github issues 8:01 Start coding 8:41 Normalize the fruit score 10:44 Pick a fruit randomly according to its probability 12:13 Diagram the algorithm 15:50 Verify the algorithm works 17:48 Advantages of the algorithm 18:16 Outro Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound 🚂 Website: https://thecodingtrain.com/ 👾 Share Your Creation! https://thecodingtrain.com/guides/pas... 🚩 Suggest Topics: https://github.com/CodingTrain/Sugges... 💡 GitHub: https://github.com/CodingTrain 💬 Discord: https://thecodingtrain.com/discord 💖 Membership: http://youtube.com/thecodingtrain/join 🛒 Store: https://standard.tv/codingtrain 🖋️ Twitter:   / thecodingtrain   📸 Instagram:   / the.coding.train   🎥    • Coding Challenges   🎥    • Start learning here!   🔗 p5.js: https://p5js.org 🔗 p5.js Web Editor: https://editor.p5js.org/ 🔗 Processing: https://processing.org 📄 Code of Conduct: https://github.com/CodingTrain/Code-o... This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod... #poolselection #probability #p5js