create account

Genetic Algorithm by puhoshville

View this thread on: hive.blogpeakd.comecency.com
· @puhoshville · (edited)
$193.31
Genetic Algorithm
Hi, Steemers!
----------
I love math, especially geometry. But also love to observe the world of ideas and what a brilliant application they find in different areas. And today I'd like to tell you small interest fact from algorithm theory. You will learn how important it is to listen to nature.

![evo-chain](https://s9.postimg.org/59f074sj3/01_evolutionary_chain.jpg)

Everyone knows who is Charles Darwin and his major discovery - the theory of evolution. It so clearly describes the process of formation of the most viable species. Interestingly, this theory played a role in the formation of computing algorithms.  And genetic algorithm was born due to the theory. This algorithm mimic features of natural selection and leads to the optimal solution.

The basic principles formulated by Darwin:
1. the strongest survive and crips die (natural selection);
2. the new individual is obtained by crossing and there is mutation;

As it turned out, this concept is very well suited for finding the maximum of the function. In General, the algorithm can be described in this scheme.

![scheme](https://s9.postimg.org/9m9euyvbz/algo.png)



Application Example 1
-------------
In the simplest case, the vectors plays the role of the *individuals*, their arithmetic average is the *result of crossing* and *mutation* - adding noise to the coordinates of the vector. So, using the algorithm we can get the best vector (that maximizes the a function). I've found a cool GIF:
![GIF that demonstrate GA](https://s9.postimg.org/lqooby87z/GAgif.gif)

More than Gradient descent
--------------
Some of us knows that the algorithm GD(gradient descent) is also used for finding the maximum of the function. Moreover, various modification of it finds it faster. But why do we need GA(genetic algorithm)? The answer is simple. GD only works with differentiable  functions. This means that arguments are only real numbers. But the genetic algorithm is ready to work with functions, regardless of their arguments - the main thing to determine the crossing of two individuals and mutation.

Application Example 2
-----------------
![Car Generator](https://s4.postimg.org/k0rnty87h/car_Generator.png)
Here are an illustrative implementation of the genetic algorithm. [Car Generator](http://rednuht.org/genetic_cars_2/).
You can play with the settings to achieve maximum results. My maximal score - 140m (I haven't played for a very long time).

ะกonclusion
----------------
We see another example of copying ideas of nature for solving problems of humanity. The principles which are very easy to formulate and beautiful result - it makes me admire.
This publication is the first in a series of publications about the beauty of nature and science. If you have something you admire from science, then share this fact with me in the comments. Thank you for your attention.
๐Ÿ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorpuhoshville
permlinkgenetic-algorithm
categorypopularscience
json_metadata{"tags":["popularscience","science","mathematics","nature"],"image":["https://s9.postimg.org/59f074sj3/01_evolutionary_chain.jpg"]}
created2016-08-14 01:31:33
last_update2016-08-14 01:42:30
depth0
children11
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value145.118 HBD
curator_payout_value48.192 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,849
author_reputation2,557,225,302,857
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id792,632
net_rshares27,945,780,361,154
author_curate_reward""
vote details (64)
@complexring ·
$0.09
These look like all local optima.  Is there a global solution?
๐Ÿ‘  ,
properties (23)
authorcomplexring
permlinkre-puhoshville-genetic-algorithm-20160814t021515460z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 02:15:15
last_update2016-08-14 02:15:15
depth1
children4
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.068 HBD
curator_payout_value0.019 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length62
author_reputation62,649,292,215,598
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id793,023
net_rshares100,099,726,067
author_curate_reward""
vote details (2)
@puhoshville ·
$0.02
It is impossible to guarantee finding the global maximum. In the case of highly corrugated surfaces, the algorithm does not get stuck when getting into a local maximum, in contrast to Gradient Descent.
๐Ÿ‘  ,
properties (23)
authorpuhoshville
permlinkre-complexring-re-puhoshville-genetic-algorithm-20160814t024201662z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 02:42:00
last_update2016-08-14 02:42:00
depth2
children3
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length201
author_reputation2,557,225,302,857
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id793,262
net_rshares29,098,583,519
author_curate_reward""
vote details (2)
@complexring ·
$0.02
You should look into the methods of Applied Algebraic Geometry Groebner Bases (Symbolic) or Homotopy Methods (Numeric) which can guarantee finding a global maximum.
๐Ÿ‘  ,
properties (23)
authorcomplexring
permlinkre-puhoshville-re-complexring-re-puhoshville-genetic-algorithm-20160814t091051857z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 09:10:51
last_update2016-08-14 09:10:51
depth3
children1
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length164
author_reputation62,649,292,215,598
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id796,183
net_rshares34,539,029,827
author_curate_reward""
vote details (2)
@plotbot2015 ·
And the reason that it doesn't get stuck (permanently) is that the genetic algorithm is usually stochastic, meaning that the recombination of the parental programs is somewhat random, so it can "jump" local bumps, given enough time.
properties (22)
authorplotbot2015
permlinkre-puhoshville-re-complexring-re-puhoshville-genetic-algorithm-20160826t213038899z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-26 21:30:39
last_update2016-08-26 21:30:39
depth3
children0
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length232
author_reputation15,879,930,254,115
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,004,418
net_rshares0
@individ ·
On the picture you can see that some highs are generally not taken into account.  In addition, often a local maximum is taken for global.  It is best to specify the function explicitly, and solve it. Moreover, the mathematical apparatus in this area is severely underdeveloped.
properties (22)
authorindivid
permlinkre-puhoshville-genetic-algorithm-20160814t054654007z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 05:46:54
last_update2016-08-14 05:46:54
depth1
children1
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length277
author_reputation-12,203,006,625
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id794,841
net_rshares0
@puhoshville ·
If function is differentiable, it is certainly better to solve problem explicitly. If the function is bad, considering it an approximation we can get a lot of false highs.
View review from complexring - perhaps mathematics is developed enough.
properties (22)
authorpuhoshville
permlinkre-individ-re-puhoshville-genetic-algorithm-20160814t122705327z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 12:27:06
last_update2016-08-14 12:27:06
depth2
children0
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length243
author_reputation2,557,225,302,857
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id797,515
net_rshares0
@lemouth ·
Do you plan to give more examples, maybe in future posts? I would love to learn more about that and also get some concrete examples of genetic algorithms so that I could understand better.
properties (22)
authorlemouth
permlinkre-puhoshville-genetic-algorithm-20160814t133317614z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 13:33:18
last_update2016-08-14 13:33:18
depth1
children1
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length188
author_reputation338,011,164,701,274
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id798,170
net_rshares0
@puhoshville ·
Thank you for your attention!) Definitely I will give you more material! Follow me - it will be interesting!)
properties (22)
authorpuhoshville
permlinkre-lemouth-re-puhoshville-genetic-algorithm-20160814t153829760z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 15:38:30
last_update2016-08-14 15:38:30
depth2
children0
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length109
author_reputation2,557,225,302,857
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id799,886
net_rshares0
@peteyates ·
enjoyable post :) the case of flying machines is interesting though. imitations of bird flight didn't really work in the early days. what worked was a barn door strapped to a lawn mower engine and a bicycle (or the like) ....
properties (22)
authorpeteyates
permlinkre-puhoshville-genetic-algorithm-20160814t152727247z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 15:27:21
last_update2016-08-14 15:27:21
depth1
children1
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length225
author_reputation8,900,266,075
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id799,741
net_rshares0
@puhoshville · (edited)
Someone noticed that the door is very similar to the wing)
properties (22)
authorpuhoshville
permlinkre-peteyates-re-puhoshville-genetic-algorithm-20160814t162309479z
categorypopularscience
json_metadata{"tags":["popularscience"]}
created2016-08-14 16:23:09
last_update2016-08-14 16:23:18
depth2
children0
last_payout2016-09-13 19:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length58
author_reputation2,557,225,302,857
root_title"Genetic Algorithm"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id800,561
net_rshares0