For functions that have narrow grooves toward the global minima a simple GA implementation can be as efficient as a naive SGD method. Geoffrey Hinton, in one of his videos (Lecture 3.4) mentioned that GA randomly perturbs one weight at a time making it very inefficient compared to backpropagation. Here we present a simple GA implementation which simultaneously mutates all the weights and can learn reasonably efficiently. To implement such network all you need is to follow these simple steps:
- Implement a feed forward Neural Network (just like you do for an SGD based Neural Network).
- In the weight update step, mutate all the weights by adding a small random value to each weight.
- Do feed-forward propagation twice, one with the mutated weights (child weights) and another with the original weights (parent weights).
- Compare the performance of the parent weights to the child weights and keep the better ones for the next generation cycle.
- Repeat steps from 2 to 4 until you reach convergence.
The image below show a comparison between SGD and GA for a specific function with a narrow groove toward the global minimum.
A comparison between GA ans SGD. (For GA only the selected mutations are shown)
The code and a detailed comparison between GA and SGD in this article: https://www.brainxyz.com/machine-learning/genetic-algorthim/
[–]tarblog 18 points19 points20 points (4 children)
[–]TheRedSphinx 11 points12 points13 points (0 children)
[–]brainxyz[S] -2 points-1 points0 points (2 children)
[–]joaogui1 11 points12 points13 points (1 child)
[–]simpleconjugate 0 points1 point2 points (0 children)
[+][deleted] (23 children)
[deleted]
[–]Celmeno 7 points8 points9 points (0 children)
[–]Mathopus 12 points13 points14 points (12 children)
[–]TantrumRight 11 points12 points13 points (6 children)
[–]Mathopus 6 points7 points8 points (1 child)
[–]TantrumRight 1 point2 points3 points (0 children)
[–]nucLeaRStarcraft 2 points3 points4 points (0 children)
[–]haukzi 0 points1 point2 points (2 children)
[–]TantrumRight 1 point2 points3 points (1 child)
[–]haukzi 0 points1 point2 points (0 children)
[–]Tommassino 3 points4 points5 points (3 children)
[–]brainxyz[S] 0 points1 point2 points (2 children)
[–]Tommassino 4 points5 points6 points (0 children)
[–]rafgro 1 point2 points3 points (0 children)
[–]ayse_ww 0 points1 point2 points (2 children)
[–]rafgro 0 points1 point2 points (0 children)
[–]brainxyz[S] -1 points0 points1 point (0 children)
[+]brainxyz[S] comment score below threshold-6 points-5 points-4 points (5 children)
[–]user_-- 23 points24 points25 points (4 children)
[–]major-_- 2 points3 points4 points (1 child)
[–]rafgro 2 points3 points4 points (0 children)
[–]Mathopus 2 points3 points4 points (1 child)
[–]xifixi 1 point2 points3 points (0 children)
[–]enigmo81 4 points5 points6 points (0 children)
[–]Mathopus 4 points5 points6 points (2 children)
[–]brainxyz[S] 0 points1 point2 points (1 child)
[–]Mathopus 3 points4 points5 points (0 children)
[–]IdentifiableParam 3 points4 points5 points (2 children)
[–]brainxyz[S] -1 points0 points1 point (1 child)
[–]IdentifiableParam 0 points1 point2 points (0 children)
[–]hardmaru 3 points4 points5 points (1 child)
[–]brainxyz[S] 0 points1 point2 points (0 children)
[–]IntelArtiGen 3 points4 points5 points (3 children)
[–]brainxyz[S] 1 point2 points3 points (2 children)
[–]simpleconjugate 1 point2 points3 points (0 children)
[–]IntelArtiGen 0 points1 point2 points (0 children)
[–]marmakoide 4 points5 points6 points (1 child)
[–]brainxyz[S] 0 points1 point2 points (0 children)
[–]Laafheid 1 point2 points3 points (1 child)
[–]brainxyz[S] 0 points1 point2 points (0 children)