gmlewis

gmlewis

Genetic Algorithms in Elixir: Some feedback, a question and suggestion

@seanmor5 - This is a great book so far… I’m enjoying reading and coding along with it!

Quick question, though - since “evaluate” goes to the trouble of calling the “fitness_function” and generating an updated list of Chromosomes with the new calculated “fitness” values in the struct, instead of ending the function with this (where it has to call the “fitness_function” a bunch more times):

 |> Enum.sort_by(fitness_function, &>=/2)

why not end it with this (in order to use these pre-calculated values)?

|> Enum.sort_by(& &1.fitness, &>=/2)

Also, I’m kinda sad that you dismissed the tree-type genetic programming like John Koza did in the 60s and 70s (to generate electronic circuits and a whole bunch of other cool stuff), but that is a huge topic in itself. Also, I’m extremely interested in Gene Expression Programming invented by Dr. Candida Ferreira, but that is also tree-type.

Anyway, thanks for the great book, and I look forward to your updates!

– Glenn

9 751 5

Marked As Solved

seanmor5

seanmor5

Author of Genetic Algorithms in Elixir

Good catch! I think that’s the result of me forgetting to update the call to sort_by after I added in the fitness calculation for each chromosome. I’ll make sure that gets fixed.

I thought a lot about whether or not to include some examples of Genetic Programing and other tree-type methods. Ultimately I thought it might have been a lot of overhead just to get a simple example up and running and I was trying to cover a lot of ground without getting too carried away with any one topic. I was also trying to make sure the topics built on top of one another and felt like a dive into tree-based encodings and their applications would have been too much of a detour from the progression of the book.

Now that you mention it I think a dive into tree-based encoding schemes would make for an excellent supplement to the book. I’ll put something together and release it on my blog for anybody who’s interested.

Also Liked

seanmor5

seanmor5

Author of Genetic Algorithms in Elixir

Thanks for the suggestion. It’s in my profile. Not much content…yet.

gmlewis

gmlewis

Awesome! Can you please provide a link to your blog? I don’t remember seeing it in the book (yet).

Also, just for kicks, you might enjoy checking out my early attempts of Gene Express Programming (in Go) from a few years back: GitHub - gmlewis/gep: Gene Expression Programming in Go

– Glenn

AstonJ

AstonJ

You could add it to your profile as well Sean :+1:

Where Next?

Popular Pragmatic Bookshelf topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
14 2929 7
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
10 2622 9
New
ianwillie
Hello Brian, I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
0 1500 3
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
22 1619 20
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
0 4877 3
New
jgchristopher
“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ” Excerpt From: Br...
3 1035 6
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
0 7996 6
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
0 1940 4
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
6 1112 5
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
0 2059 6
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
54 3555 17
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
30 3579 14
New
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
49 5284 39
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
15 8183 19
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
166 7775 69
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
66 21694 24
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
19 3178 10
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
62 6351 19
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
0 2183 2
New

Sub Categories: