Genetic Algorithms in Elixir (PragProg)

From finance to artificial intelligence, genetic algorithms are a powerful tool with a wide array of applications. But you don't need an exotic new language or framework to get started; you can learn about genetic algorithms in a language you're already familiar with. Join us for an in-depth look at the algorithms, techniques, and methods that go into writing a genetic algorithm. From introductory problems to real-world applications, you'll learn the underlying principles of problem solving using genetic algorithms.

Sean Moriarity @seanmor5

edited by Tammy Coron @Paradox927

From finance to artificial intelligence, genetic algorithms are a powerful tool with a wide array of applications. But you don’t need an exotic new language or framework to get started; you can learn about genetic algorithms in a language you’re already familiar with. Join us for an in-depth look at the algorithms, techniques, and methods that go into writing a genetic algorithm. From introductory problems to real-world applications, you’ll learn the underlying principles of problem solving using genetic algorithms.

Evolutionary algorithms are a unique and often overlooked subset of machine learning and artificial intelligence. Because of this, most of the available resources are outdated or too academic in nature, and none of them are made with Elixir programmers in mind.

Start from the ground up with genetic algorithms in a language you are familiar with. Discover the power of genetic algorithms through simple solutions to challenging problems. Use Elixir features to write genetic algorithms that are concise and idiomatic. Learn the complete life cycle of solving a problem using genetic algorithms. Understand the different techniques and fine-tuning required to solve a wide array of problems. Plan, test, analyze, and visualize your genetic algorithms with real-world applications.

Open your eyes to a unique and powerful field—without having to learn a new language or framework.


Sean Moriarity graduated from the United States Military Academy with a degree in Computer Science. Sean was first introduced to genetic algorithms while on a summer internship which inspired him to write Genex, a library for writing evolutionary algorithms in Elixir. Many of the problems and solutions you’ll encounter in this book were inspired from the lessons learned while developing Genex. Sean’s passions include functional programming, artificial intelligence, mathematics, and, of course, evolutionary algorithms.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

9 Likes

Corresponding tweet for this thread:

Share link for this tweet.

1 Like

This book looks really interesting - and I love the cover!!

I think I’d like to read it out of plain curiosity as it’s not a topic I am familiar with at all (maybe someone could write a journal about it or create a book club for it?)

Sean, do you need to know anything other than Elixir to read this book? Who is it aimed at and where might you typically use or put to use what you learn in this book? Also just out of curiosity, what made you want to write a book about this particular topic? Sorry about all the questions! (I have an inquisitive mind :see_no_evil:)

3 Likes

I’m glad to hear your interested! You don’t need to know anything other than Elixir to read and understand the book. The book is aimed at Elixir developers who are curious about Genetic Algorithms. I wanted to introduce the community to something they wouldn’t otherwise encounter. I know it can be frustrating to have interest in a new topic/technology and have to force yourself to learn a new language/framework.

I think Genetic Algorithms are extremely powerful and often forgotten. They can be used in conjunction with and to replace neural networks. For example, NEAT is an algorithm for evolving neural networks, and I know there’s a pure Elixir on the web somewhere. You can also use Genetic algorithms as a replacement for neural networks and other ML approaches in reinforcement learning. NASA used genetic algorithms to evolve antenna design within some parameters. I’ve also seen genetic algorithms for evolving web pages towards an optimal design where optimality was judged by human raters.

There’s a lot of other examples in the book. Generally any time you run in to an optimization problem, genetic algorithms are an excellent tool.

I hope this answers your questions!

EDIT: NEAT implementation in Elixir - https://gitlab.com/onnoowl/Neat-Ex

7 Likes

That’s very helpful, thanks Sean!

I think you will definitely succeed in this goal! I am already curious and it wasn’t a topic I was otherwise thinking about looking into anytime soon! I am sure others may be equally intrigued :sunglasses:

Nice! Funnily enough I have been thinking about design related best practices a lot recently (and how I want to through all the rule books out :laughing:) so this could actually be really interesting for me!

One last question, is the book easy enough to read on a Kindle? Or do you need to be in front of your computer as it requires you to follow along? I know PragProg are proponents of offering a great e-reader experience but I know it can sometimes depend on the direction and content of the book.

I think the book is easy enough to read on Kindle. You’ll be able to grasp the concepts and see how they get implemented in Elixir. By the end of the book, you’ll have a working framework you can use to play around with to write your own Genetic Algorithms. If you don’t feel like following along by hand, you can just download the source and use the completed framework available in the final chapter!

On a side note, I think the idea of web page optimization would be really cool. The original resource I saw it in is this paper: https://core.ac.uk/download/pdf/38910449.pdf

It’s long (104 pages) and dated (from 2007), but walks you through the steps they took to implement web page evolution. I think it would be really cool to combine something like that with Phoenix Live View so a user could “evolve” a web design in real time and watch the evolution as it progresses. I’m not sure how viable/useful it would be, but it’s definitely interesting!

3 Likes

Ah that’s good. I think PragProg has some official guidance on things like ensuring code is duplicated whenever it makes sense to (so that people on e-readers don’t have to click back several pages to find it).

I opened the PDF then wondered why the demo/link it mentioned did not work - came back to see it was from 2007 :joy:

That does sound cool!

I’m definitely interested in reading the book, can’t promise when tho unfortunately. Hopefully I’ll be able to twist someone’s arm to read it with me so we can do a journal or book-club about it :nerd_face:

For anyone reading, Sean gets a mention here too - he’s been working with José on Numerical Elixir :smiley:

2 Likes