This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of multi objective plotting in Deap | |
# Derek M Tishler - 2018 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
plt.rc('xtick', labelsize=8) | |
plt.rc('ytick', labelsize=8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GA example of an array of constrained value items with crossover and mutation, | |
# from question https://groups.google.com/forum/#!topic/deap-users/bu3v9Ozez8E | |
# Derek M Tishler - 2019 | |
# Started with example and modified to keep as simple as possible: | |
# https://raw.githubusercontent.com/DEAP/deap/454b4f65a9c944ea2c90b38a75d384cddf524220/examples/ga/onemax_np.py | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Examples on how to extract and plot fitness diversity for a population, hall of fame, or | |
# frontier using histogram and probability curves. Mostly working with multi objective fitness as per | |
# question from https://groups.google.com/forum/#!topic/deap-users/Y8JX4AKwzhk | |
# Derek M Tishler - 2019 | |
import array | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is part of EAP. | |
# | |
# EAP is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as | |
# published by the Free Software Foundation, either version 3 of | |
# the License, or (at your option) any later version. | |
# | |
# EAP is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ITS GONE! | |
I generalized the code and created examples for use in GA and GP: | |
https://github.com/DMTSource/deap_ray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is part of DEAP. | |
# | |
# DEAP is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as | |
# published by the Free Software Foundation, either version 3 of | |
# the License, or (at your option) any later version. | |
# | |
# DEAP is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Derek Tishler | |
# Aug 3 2020 | |
# Based On: | |
# https://github.com/DEAP/deap/blob/master/examples/ga/onemax_short.py | |
# V2 | |
import array | |
import random | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Derek Tishler, answering a question from Deap Discussions: | |
# For Ning's question: https://groups.google.com/forum/#!topic/deap-users/W8wacFPyj9Y | |
# Based on symbreg example: https://github.com/DEAP/deap/blob/master/examples/gp/symbreg.py | |
# eaSimpleWithElitism from: https://github.com/PacktPublishing/Hands-On-Genetic-Algorithms-with-Python/blob/master/Chapter04/elitism.py | |
import operator | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of using selTournamentDCD requiring assignCrowdingDist | |
# Based on deap/examples/ga/onemax_numpy.py | |
# https://github.com/DEAP/deap/blob/master/examples/ga/onemax_numpy.py | |
# Discussion: | |
# https://groups.google.com/forum/#!topic/deap-users/uU382eztuts | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of creating an individual with multiple 'parts' | |
# Derek M Tishler, Oct 2020 | |
''' | |
Evolve a complex structure/individual, such as encoded hyperparamters of a mlp classifier | |
individual_example = [encoded_solver__int, learning_rate__float, hidden_units__list] | |
example of a 10 layer network using adam solver with learning rate ~0.007: | |
[0, 0.006592, [13, 89, 21, 100, 96, 100, 16, 67, 45, 88]] | |
''' |
OlderNewer