Skip to content

Instantly share code, notes, and snippets.

@macrintr
macrintr / deap_functions_with_memory.py
Last active Aug 29, 2015
DEAP setup to create functions with memory
View deap_functions_with_memory.py
"""
Author: Thomas Macrina
Date created: 06/23/2014
Python Version: 2.7
Use global class to allow GP functions to access previous values
"""
import random
from operator import *
@macrintr
macrintr / deap_ephemerals_scoop.py
Last active Aug 29, 2015
Simple DEAP strongly-typed GP setup to demonstrate difficulties with ephemerals and scoop
View deap_ephemerals_scoop.py
"""
Author: Thomas Macrina
Date created: 04/15/2014
Python Version: 2.7
Simple DEAP strongly-typed GP setup to demonstrate
difficulties with ephemerals and scoop.
"""
import sys
@macrintr
macrintr / gp_from_string_fix.py
Last active Aug 29, 2015
Updating from_string method in DEAP gp.py PrimitiveTree class
View gp_from_string_fix.py
"""
File name: gp_from_string_fix.py
Author: Thomas Macrina
Date created: 03/21/2014
Python Version: 2.7
Overwriting the from_string() method within DEAP's gp.py
to properly function with a strongly-typed primitive set.
line 30 corresponds to line 100 in gp.py v1.0.0
@macrintr
macrintr / gp_alter.py
Last active Feb 8, 2021
Removing "dummy" node need from STGP within DEAP
View gp_alter.py
"""
File name: gp_alter.py
Author: Thomas Macrina
Date created: 03/21/2014
Python Version: 2.7
Overwriting the generate() method within DEAP's gp.py
to remove the need for "dummy" nodes within strongly-typed
individuals.