Introduction to Genetic Algorithms
blog.floydhub.com
blog.floydhub.com
This is what the GA came with up for the design given the constraints: https://en.wikipedia.org/wiki/Genetic_algorithm#/media/File%...
And this paper describes the process: http://ti.arc.nasa.gov/m/pub-archive/1244h/1244%20(Hornby).p...
The distinction arises because the basic idea of evolutionary computing was independently explored from at least four different directions: genetic algorithms (evolving parameters of fitness functions), genetic programs (evolving program descriptions), evolution strategies (evolving vectors, often including parameters of the evolution process) and learning classifier systems (evolving populations of rules).
Edit: on the other hand, the paper linked specifically calls it out as genetic algorithms. Where's my hat, I feel peckish.
Based on my understanding of the paper, the members of the population were individuals which each encoded an antenna design as lengths of wire segments and rotations between segments. They weren't programs but rather what amounts to descriptions of geometric forms. So the output wasn't a program that was run to give an antenna, it was list of wire segments to assemble together in a certain way. But maybe the differences in in our interpretation comes down to mostly semantics.
But seen as a string of symbol-value pairs, GA is the proper fit I think.
Worked 'fine'
Later they redesigned the product to use a better classic PCB antenna and it 'sucked'.
There are also simulation tools that allow you to simulate antenna's.
That depends on the particular problem you are trying to solve. If hill climbing works for your problem, then you are lucky and you should not use GAs.
My personal story: I worked for just under a decade on EAs (PhD and professionally, late 90s and early 00s). I don't entirely disagree with you about pure GAs. But even back then, pure GAs were rarely used. But I do disagree about evolutionary algorithms in general.
The usefulness of EAs is highly problem dependent. And I will definitely concede that the space of problems in which they excel and are tractable is smaller than the space of problems for something like a neural network, in my experience.
As for crossover, when it works (and in engineering contexts the operator needs to be designed with the problem in mind) it does so by allowing individuals at different points on the landscape to share the optimisations they find. At the cost of increased genetic load. This, of course, is only useful if the fitness landscape is both heavily multimodal and self-similar. And it requires some effort to avoid the population converging around a single solution (where you do have a stochastic hill climb).
In my experience, EAs come into their own with non-fixed genotypes or complex genotype to phenotype expression. Multivariate optimisations with a fixed number of variables is probably best done with other tools.
The only thing that EAs and neural networks have in common is the buzzword abuse. Neural networks are actually useful as they are at their core an efficient way to approximate multivariate functions, while EAs are computationally expensive heuristics abused by being passed off as optimization algorithms even in domains where deterministic algorithms (and even brute force approaches) actually perform better.
I thought they were really nifty when I first heard of them, but thinking of them as an optimization procedure, they don't really stand up in my experience to basic gradient descent methods. Sure, you can e.g. train a neural network with genetic algorithms, but why would you?
I'd love to be proven wrong though :)
But in general the "No Free Lunch Theorem"[1] shows that no optimisation algorithm is "better" than any other across the universe of all possible problems.
So it's going to be some balance of your familiarity with GAs, having a problem domain that maps nicely to some simple input structure but which has a relatively gnarly surface to search and whether you could do it better in some other way.
These days the clear winner is various kinds of neural nets, largely because they can be represented with matrix multiplication, which made them suitable first for GPUs and now for much more specialised hardware.
I've had them in mind for searching autoscaler parameters, mostly because I feel it's easier to reason about a GA's optimisations than a series of matrix multiplications resulting in a cloud of floating point numbers.
* gender (try to get mixed gender groups and atleast have two of each gender in a group e.g. no 1 female + 4 males)
* skill types and skill level (so correct combination of skills and skill levels)
* bunch of other rules and stats
At first I brute forced it, but didn't work very well, then with a few tweaks I used a simulated annealing algorithm which worked perfectly. I believe genetic algorithms can solve the same problems like that though.
People have also had good results using GA to optimize Yagi-Uda arrays. In that case, it is very easy to map design parameters onto a "gene vector" in a way that is well-understood and such that it yields an understandable result. But that is really just a search problem, so maybe other algorithms would do as well.
I think the realistic strength is that there are some easy to use libraries that don't require the user to really know anything about optimisation or work too hard and can deal with very difficult optimization scenarios (and sometimes even deal with them well).
Plus they're neat-o. That's gotta count for something. You ever try the island variant?
That's a poor assertion because even if detivative-free algorithms weren't already a thing, there are a myriad of smoothing techniques that enable nondifferentiable objective functions to be approximated by differentiable functions.
> I think the realistic strength is that there are some easy to use libraries that don't require the user to really know anything about optimisation or work too hard and can deal with very difficult optimization scenarios (and sometimes even deal with them well).
That's also not a reasonable assertion because there are also plenty software libraries for continuous and discrete optimization that are easy to use.
GAs in general are explored in academia because they are a fad that's easily publishable. Other than that this class of methods is in general very computationally expensive and very inefficient, and don't provide any advantage over plain old adaptive sampling, or even dumb regular lattice sampling.
I would say 90% of GA papers are because of this.
> Other than that this class of methods is in general very computationally expensive and very inefficient, and don't provide any advantage over plain old adaptive sampling, or even dumb regular lattice sampling.
Definitely false. The vast majority of OR-type papers in good journals include comparison to weak baselines like those, and wouldn't be published (in those venues) if they didn't win.
That statement is not correct. Although it's customary to accompany papers with benchmarks, these benchmarks focus practically exclusively on popular evolutionary algorithms. Worse, the "no free lunch" theorem grants authors the freedom to cherry-pick which benchmark problems are used.
About NFL, I agree that a lot of authors misuse it in that way. But again, in most papers in good journals, what we see is either a comprehensive experiment with a wide enough range of instances, or a real industry problem, not cherry-picking.
Those methods are invariably other evolutionary methods, and benchmarks are cherry-picked to show only encouraging results under the convenient guise of the "no free lunch" theorem. That' pretty much the norm, such as the repetitive recipe for inventing a metaheuristic algorithm of a) coming up with a clever nature-inspired metaphor with a catchy name, b) put together an algorithm that is arguably inspired on the metaphor, c) come up with a benchmark that arguably portrays the algorithm as being any improvement, even if only on a fortuitous corner case.
I agree that many papers of that recipe type exist -- Sorensen and Weyland have skewered them effectively -- they are just froth, to be ignored in a discussion of the true merits of evolutionary computation.
The function you wish to optimise may be non differentiable because the domain is discrete. E.g. to perform feature selection one can binary encode which features are included and which are excluded, with the fitness function being the accuracy of a model using the included features as inputs and trained for X iterations.
0) there is not enough data for you to train a NN, and
1) you have a really huge solution space for the problem that you cannot brutal force, and
2) you can encode each solution into a simple ``string'' (chromosome), and
3) the problem you're trying to solve is not very time critical (GA can take seconds to minutes depending on your problem)
Also, GA can actually utilize many CPU or even GPU cores to solve the problem much faster.
Ha. Days or weeks is typical for complex problems.
There were a lot of constraints, and several applications were used at different points (e.g. specialised 3D CAD) - a single generation took around 1 hour, so we had to let it run for days at a time on a cluster to be useful.
I actually kind of surprised, because I didn't realise people still used GAs any more, let alone such a standard implementation.
GA might be better than gradient descent when you can’t compute a gradient because the function you’re optimizing isn’t differentiable.
GA is useful for interactive evolution, when the fitness function is a human.
I'd complement the "can't compute a gradient" also with the "gradient won't help you" cases (lots of local maxima/minima )
The knapsack problem(2), of which fantasy team picking is an example, is a classic use case for genetic algorithms.
1) https://github.com/chrxr/ga-prem-team/blob/master/scripts/ga... 2) https://en.wikipedia.org/wiki/Knapsack_problem
The solution my program "evolved" was the best in the company.
http://dinsights.com/POTM/LOAPS/finals.php
The game's scoring system was based on Lines of Action but added an alternative goal which was to win by points. So in order to play this game well a bot had to balance progress towards one of the goals with the need to make sure the opponent didn't get too far ahead in the other goal. My program was the output of a genetic algorithm that learned a remarkably good balance between these two sometimes competing goals. Before I used the genetic algorithm I spent a lot of time hand tuning the evaluation function and actually came up with a quite good result that I was unable to improve on. When I ran the genetic algorithm I was thrilled to discover that the genetic algorithm's output totally crushed my hand tuned output.
After my program won the contest with an undefeated 74-0-0 record the author of one of the best Lines of Action computer programs in the world played his program against mine. If the organizer of the programming contest had chosen just a slightly different scoring system that was biased a little more towards the Lines of Action goal, then my program would probably lose against the Lines of Action program. The author played two games of his program against my program. Both games ended with his program thinking it won by Lines of Action rules and my program thinking it won by the tweaked contest rules! This suggests that the organizer of the contest had done a particularly good job of balancing the different goals of the game. (No, this paragraph is about the organizer's game design and has nothing to do with the question of genetic algorithms. I just thought it was an interesting side note.)
I really have no idea of whether gradient descent optimization methods would have been better or not. But this was an area where genetic algorithms worked very well.
A few days ago I used GA to perform feature selection (binary encoding with 0 indicating a feature is excluded, 1 if included, fitness function was the accuracy of a NN taking the included features as inputs and trained with gradient descent for x epochs). This made my final network smaller, train faster, etc.
It seems like you could implement effectively any function with a complicated enough combination of fitness, selection and mutation functions but without a theory of which to use, progress would be a bit hard.
In my experiments with GAs, defining a coefficient for mutation that is either far too high or far too low means you search search for too much of the problem search space or far too little, respectively. Testing parameters such as the frequency of mutation are part of the iterative process of tuning your GA.
Once you have used them for a while, you start to get a feel - if the optimization is rapidly converging to a poor solution, you need more variation - more mutation, bigger population, etc. if the solution is converging very slowly, you need Less variation.
I like to set up the functions as Gaussian, then the parameter controlling the variation is a well understood sigma.
'Dawkins speculated that the unnatural selection role played by the user in this program could be replaced by a more natural agent if, for example, colourful biomorphs could be selected by butterflies or other insects, via a touch-sensitive display set up in a garden.' (from the wikipedia article).
I guess it's because of the similarities to the evolution of life, but also because they're just quite simple.
Genetic algorithms beat simulated annealing when different dimensions of your solution interact strongly and unpredictably, SA and gradient searches completely fail at those cases.
I’m really excited by the conversation this has generated and I’m happy to answer any questions.
What about situations when there are no real optima and minima, but only intransitive relations? So "rock/paper/scissor"-like scenarios[0]. Could you use genetic algorithms in any way in those circumstances?
https://aeon.co/essays/attempts-to-choose-the-best-life-may-...
If you’re trying to do something like predict the next move based on historical patterns, I think a classifier would be better.