Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 22 23:17
    jfrfonseca commented #268
  • Aug 22 23:11
    jfrfonseca commented #268
  • Aug 22 23:08
    jfrfonseca commented #268
  • Aug 22 05:39
    zhenlingcn opened #403
  • Aug 20 21:27
    gutzbenj commented #392
  • Aug 20 08:39
    simonegiacomelli opened #402
  • Aug 16 02:15
    loganthomas opened #401
  • Aug 16 01:35
    loganthomas closed #400
  • Aug 16 01:35
    loganthomas commented #400
  • Aug 15 09:51
    fmder commented #400
  • Aug 15 02:23
    loganthomas opened #400
  • Aug 09 13:45
    Freakwill synchronize #398
  • Aug 09 13:44
    Freakwill synchronize #398
  • Aug 09 11:50
    Freakwill commented #398
  • Aug 09 11:49
    Travis DEAP/deap#398 canceled (411)
  • Aug 09 11:49
    Freakwill synchronize #398
  • Aug 09 11:49
    Freakwill synchronize #398
  • Aug 09 03:19
    Freakwill synchronize #398
  • Aug 09 03:00
    Travis DEAP/deap#398 canceled (408)
  • Aug 09 03:00
    Freakwill synchronize #398
Eddie Pantridge
@erp12
Thanks @fmder. I am still a bit unclear about decorations in general. Does the decoration I mentioned above check to make sure that the child produced by "mate" and "mutate" have a depth less than 89? or does it check to make sure that the no more than 89 nodes are added to the existing tree (which might be already be large)?
Eddie Pantridge
@erp12
To give some context: I am trying to test the difference between a few selection methods I have written. I am running a modified version of the even parity problem. I have been testing with 3 to 5 input bits, but I am taking out the 'xor' primitive. This makes it much harder. I need my population size to be 100 or higher, and when comparing to some literature I should expect well over 100 generations as well. It seems when I let DEAP run for that long, it always crashed due to a tree reaching above 90 depth.
I still get this problem when adding decorations, although it seems I can have longer generations. Ideally, I would like to add something that forces trees to stay below a depth of 90, and not just encourages it. Are the decorations still what I am looking for?
Eddie Pantridge
@erp12
Using @fmder 's warning about using returned individuals instead of inplace ones solved my problem, but I just want to make sure I am understanding what is happening when I set the max_value to 17 or 89 or any other number.
François-Michel De Rainville
@fmder
@erp12 If a child or mutant has higher than max_value depth, the parent or pre-mutated individual is returned.
Hakim
@h4k1m0u
In Deap's implementation of the tournament selection, it's possible that the same individual is selected multiple times in the produced population, right?
François-Michel De Rainville
@fmder
@h4k1m0u yes
Eddie Pantridge
@erp12
@fmder Thanks a bunch. That clears it up.
Gareth Pulham
@AbstractBeliefs
I'm just getting started with DEAP, and I tried modifying the OneMax demo to use a slightly different individual/fitness function, but I'm getting some issues with the crossover - can anyone point out what I'm doing wrong? http://paste.debian.net/785364/
Vipul Jain
@jainvipul1993_twitter

@channel, I am trying to implement a genetic algorithm through DEAP python module. The fitness function for an individual depends on the other individuals which are also present in the population at that point.

How can I get the complete population in list format at a certain point of evolution and use it in a evaluation method?

Ben Elliston
@bje-
Hmmm, it's very quiet in here!
Jonathan Cooper
@jonc125
I note the latest documentation is for version 1.1.0, but the latest on pypi is 1.0.2. Is there going to be a new release soon?
Looking at the list of changes, I'd rather not start a new project with an obsolete version.
Julien denos
@jdenos
Hi im new with deap and this is possibly not the best place to ask such question, but is it possible to use a spark cluster to map the evaluate function ?
Jeff Heaton
@jeffheaton
Any plans to update pypi? There are quite a few breaking changes since the last pypi push. It also looks like the API changes have settled down quite a bit, it would probably be a good time to update pypi.
Jeff Heaton
@jeffheaton
Hello Randy, I did not know you were working on DEAP. Glad to hear that you are!
Randy Olson
@rhiever
ooohh sorry, wrong channel. I thought this was the TPOT channel
Hakim
@h4k1m0u
Hello, I've used DEAP in a conference paper that was just published on IEEE (http://ieeexplore.ieee.org/document/8065898/). The paper is about the extraction of the double-bounce contributions corresponding to buildings on satellite SAR (Synthetic Aperture Radar) images, followed by an estimation of the flood depth near the extracted building. You can add it to the list of projects made with DEAP ^^
Jonathan Cooper
@jonc125

@jeffheaton

Any plans to update pypi? There are quite a few breaking changes since the last pypi push. It also looks like the API changes have settled down quite a bit, it would probably be a good time to update pypi.

Would be lovely to see this happen!
enoD
@enod
Hello, anyone had the experience of having single objective performs much better than multiobjective function?
Jackzhang
@mingzhangPHD
Hello, I wonder is the DEAP can solve the OneMax problem with 2 individuals, each individual has 10 number(0 or 1),such as [0,1,1,0,1,0,0,0,1,0], [0,0,0,1,1,0,1,0,1,0],
Thank you
blueshrapnel
@blueshrapnel
Can someone point me to a working code sample using automatically defined functions (ADFs)?
Manuel Parra
@manuparra
Hi! Have DEAP a identifier (ID) for individuals? I mean, I want to store additional information about de individuals outside of the chromosome about the chromosome
Manuel Parra
@manuparra
Is it possible?
Artem Muterko
@micgeronimo
Hi, I've recently found DEAP repo on Github and would like to contribute( functional/unit tests for start).
Maybe somebody can point me to places that need testing?
@cmd-ntrf @fmder please advise
François-Michel De Rainville
@fmder
@manuparra Yes, the History does something similar with a decorator for variation operators. It adds a unique ID and some information of relationship in the individuals.
@micgeronimo All contributions are welcomed. I think regression tests are what is most pressing. For example, benchmarking the convergence of some standard examples could help spot if there is a breaking change pretty easily.
Manuel Parra
@manuparra
Hello, Simple question. Why after using toolbox.mutate(indv), the offspring variable haven't the values changed ? I print changes inside mutation function, but not reflected in offspring.
Manuel Parra
@manuparra
@fmder Solved ! Modification in-place !
jcbro
@jcbro

Hi, I am running some tests to checkout DEAP. I have this code to instantiate a simple population of simple individuals. The individuals have features that is 1 list of integers. Fitness is calculated by summing the count of feature integers that match a goal integer. And then I run selStochasticUniversalSampling to return a new list.

import numpy as np
import deap.tools as tools

class Individual():
    def __init__(self):
        self.features = np.random.randint(low=0,high=10,size=5)
        self.goal = 5
        self.fitness = 0

    def fitness_calc(self):
        self.fitness = sum(self.features==self.goal)

class Population():
    def __init__(self):
        self.count_individual = 100
        self.list_individual = []

        for i in range(self.count_individual):
            self.list_individual.append(Individual())

    def fitness_calc(self):
        for individual in self.list_individual:
            individual.fitness_calc()

my_population = Population()
my_population.fitness_calc()

sel_population = tools.selStochasticUniversalSampling(individuals=my_population.list_individual,
                                                      k=10,
                                                      fit_attr="fitness")

print("complete")

This fails with traceback:

Traceback (most recent call last):
  File "/home/calvin/PycharmProjects/go/go_test.py", line 28, in <module>
    sel_population = tools.selStochasticUniversalSampling(individuals=my_population.list_individual,k=10,fit_attr="fitness")
  File "/home/calvin/.local/lib/python3.6/site-packages/deap/tools/selection.py", line 197, in selStochasticUniversalSampling
    sum_fits = sum(getattr(ind, fit_attr).values[0] for ind in individuals)
  File "/home/calvin/.local/lib/python3.6/site-packages/deap/tools/selection.py", line 197, in <genexpr>
    sum_fits = sum(getattr(ind, fit_attr).values[0] for ind in individuals)
AttributeError: 'numpy.int64' object has no attribute 'values'

Does the fit_attr have to be of a certain datatype? Is there a DEAP fitness datatype that must be used?

jcbro
@jcbro
Hmmm, it seems that fit_attr must be a type of DEAP class Fitness in order to access that .values?
Curi0
@xCuri0
How can I have multiple gene types ?
I need 2 floats, 1 bool and 1 int
Curi0
@xCuri0
lol this chat is so dead
Nirvana Dogra
@NirvanaDogra
Can I use DEAP to do a time series prediction ?
François-Michel De Rainville
@fmder
@xCuri0 There is a tutorial for that in the documentation
@NirvanaDogra yes, plenty of people use GA to analyse data for the financial market
@jcbro not the best place to post code try the mailing list with gist or Pastebin
Nirvana Dogra
@NirvanaDogra
I am pretty new to this field and am working with GP to predict time series data. I am no being able to understand how can I create a expression by looking data.
François-Michel De Rainville
@fmder
@NirvanaDogra isn't it some kind of regression then with the obtained function you enter a time in the future? There might be more than one way.
Nirvana Dogra
@NirvanaDogra
@fmder Thank you, for answering to my questions but can you please tell, where I can read about this topic to get greater details about this. If you know of some Git Repo which I can view to get some insight do let me know. Thanks.
Nitrooo
@Nitrooo
maybe not the best place to ask, but... any advice on which Python neural network library to use with DEAP? I need to train a NN by maximizing the result of a simulation
François-Michel De Rainville
@fmder
@Nitrooo your description is way too vague, a better place to ask this would be DEAP users mailing list.
Franek Magiera
@franekmagiera
Hello everyone :) !
I am working on a problem that requires creating a function with n inputs and k outputs. From what I know a GP tree can have only one output, so I thought I would use a list of k trees each getting the same n inputs and producing one of the k outputs.
It seems like a good idea but I am hesitant if it is a correct approach. How will crossover and mutation operators work in case of a list of trees? Will that make sense? Maybe there is a better way?
Source code I have so far below:
pset = gp.PrimitiveSet("MAIN", arity=n, prefix='x')
pset.addPrimitive(operators.addition, 2)
pset.addPrimitive(operators.subtract, 2)
pset.addPrimitive(operators.multiply, 2)
# and many more...
# One optimization objective.
creator.create("FitnessMin", base.Fitness, weights=(-1.0,))
# Arithmetic expression.
creator.create("Tree", gp.PrimitiveTree, pset=pset)
# Individual is a list consisting of n_components trees.
creator.create("Individual", list, fitness=creator.FitnessMin)

toolbox = base.Toolbox()
toolbox.register("expr", gp.genHalfAndHalf, pset=pset, min_=MIN_TREE_HEIGHT, max_=MAX_TREE_HEIGHT)
toolbox.register("tree", tools.initIterate, creator.Tree, toolbox.expr)
toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.tree, n=pop_size)

# Population.
toolbox.register("population", tools.initRepeat, list, toolbox.individual)
buse
@buseoz_gitlab
image.png
image.png
Hi, I am working with genetic algorithm in DEAP. I want to parallelize the evalution part that's why I am using multiprocessing. The problem is evaluation function works for only one individual and after that it throws an error above ( Can't pickle <function evaluation at 0x000001ED70DA28C8>: it's not the same object as ga_evaluation.evaluation). How can I solve this issue, any ideas?
François-Michel De Rainville
@fmder
@franekmagiera I think you should mate and mutate trees by pair using a for loop on zip(individual1, individual2)
François-Michel De Rainville
@fmder
@buseoz_gitlab That is a function pickling problem. Functions are tricky to pickle, but from you error message here is what I would try first : https://stackoverflow.com/questions/1412787/picklingerror-cant-pickle-class-decimal-decimal-its-not-the-same-object