Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 24 03:40
    Freakwill closed #392
  • 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)
François-Michel De Rainville
@fmder
This Gitter thing looks cool!
William Mayner
@wmayner
hey, I just started playing around with DEAP and just thought I'd point out what I think is a bug in the README example
as written, nothing seems to evolve; i think it's because the code is missing parts that do the selection?
William Mayner
@wmayner
@cmd-ntrf @fmder
Julius F.
@juliusf
hey, for my research project i just implemented a two-phase genetic algorithm using deap. does deap provide anything for meta optimization? e.g. finding the best parameter-set for the two genetic algorithms
Ian Bell
@ibell
I'm keen to develop a python-based symbolic regression + curve fitting package (a la Eureqa) that is entirely open-source, all based on DEAP. Anyone already done this? And/or interested in collaborating? I see how the symbolic regression part works, but it's not obvious how to introduce arbitrary constants, as would be needed for the coefficient fitting part.
François-Michel De Rainville
@fmder
@wmayner I think you are right! It's been a while since we revised that algorithm, something must have been lost in a revision somewhere. Thanks I'll have a look at this as soon as I can.
@juliusf Actually this is nothing more than wrapping your GAs in another GA. DEAP does not provide any specific mechanism to do that but you sure can with only what is provided in DEAP.
François-Michel De Rainville
@fmder
@ibell Ain't the ephemeral constants and fixed constants provided by DEAP working for your arbitrary constants part? You may want to look at this blog post by one close DEAP collaborator http://multigrad.blogspot.ca/2014/04/math-evolution-and-dirty-tricks.html
Ian Bell
@ibell
@fmder - I think that example was pretty much just what the doctor ordered. Thanks! I need to take a bit of time to get a handle on how exactly all the constants propagate into the code, but I with a bit of hacking I think I can get going using that example. I'll have to look into the constants support in DEAP as well. Watch this space.
Ian Bell
@ibell
@fmder I've gotten a 1D SR fitter working - it is working for simple cases of fitting polynomial-generated data. If I were to expand to multiple input variables, it isn't clear to me how I would go about doing that. That example was super-helpful by the way.
Ian Bell
@ibell
Ah never mind, I think I see how to pass multiple input variables - ARG0 to ARGN are input variables and variables above ARG(N+1) as constants to be solved for. What a nice job you guys have done with this library, so easy to use.
Ian Bell
@ibell
@fmder Is is possible to compile the gp tree into C++ code using cython, or theano, or .... ? Evaluation of the SR structure is pretty slow. Although I wonder if the compilation time actually might be more punitive than the evaluation time itself. I guess it depends on how large your input vectors are.
Werner Van Geit
@wvangeit
Hi, I'm finishing up the implementation of an IBEA (Indicator Based Ev. Alg. http://www.tik.ee.ethz.ch/pisa/selectors/ibea) selector for DEAP. The selector can be loaded as a separate module, and for performance reason includes a (small) C extension. Could this selector be pulled into the DEAP repo ? And how do we go about this ? I already have a fork of DEAP, and can create a pull request at some point. Does this needs to go into 'tools' as a separate module ?
François-Michel De Rainville
@fmder
@ibell We already tried to compile trees using AST trees and the compilation overhead was overwhelming for trees shown in examples. Hope it helps
@wvangeit The best way to integrate your work in DEAP is to open a pull request on GitHub. If you look at the mo-cma-es algorithm you'll see that it is possible to change the indicator using the indicator argument. Note that the two others indicators in the tools module haven't been tested (I pretty much thing they don't work!).
Andrew
@apullin
The genealogy tree example unfortunately no longer works, insofar as networkx/graphviz doesn't output that top-down flowchart style. Rather, it produces a radially flattened representation of the graph. All the history decorators in DEAP seem to work, so this is likely just a change in networkx. I'm going through their docs now to figure out how to get back to that great diagram format like in the docs, but if there are any graphviz experts out there that could make short work of it, that might be much quicker.
Félix-Antoine Fortin
@cmd-ntrf
@apullin the code in DEAP's documentation to plot the genealogy tree is incomplete. In order to produce the exact same graph, you need graphviz and pygraphviz. With pygraphviz, you can compute the node positions with pos=networkx.graphviz_layout(graph,prog='dot'), then pass the position as the keyword argument pos to the networkx draw function.
Ian Bell
@ibell
Has anyone else noticed a non-monotonic decrease in the objective function? What it seems like is that the elements in the hall of fame can get replaced by other entries as a result of cross-over/mating/mutation. Shouldn't the hall-of-fame be untouched? And entries in the hall-of-fame only replaced if they are dominated by a new individual?
Félix-Antoine Fortin
@cmd-ntrf
@ibell Hall-of-fame entries are only replaced if superior solutions are provided. You can look at the insert method code https://github.com/cmd-ntrf/deap-1/blob/master/deap/tools/support.py#L539.
mrjohnmiller
@mrjohnmiller
is there any provisional timeline to implement NSGA-III?
Félix-Antoine Fortin
@cmd-ntrf
@mrjohnmiller There is not, but we would gadly look at PR proposing NSGA-III implementation in DEAP. If there is no volunteer, you can start by filling an enhancement proposal in the issues tracking system.
John Mee
@johnmee
Hi, quick throwaway question regarding gp.compileADF: the docs say to put the pset that calls all the others as the last in the list of psets, but I'm finding it only works when I put the main pset first. Is the documentation backward, or am I? It does get reversed in the code, or it might relate to the order in Individual? I'm not sure too many people have used compileADF so maybe it's never been noticed or, more likely ;-) I'm just confused. Well I know that much but... just throwing it out there.
# is working for me
toolbox.register("compile", compileADF, psets=[pset, adfpset])
# is not working for me
toolbox.register("compile", compileADF, psets=[adfpset, pset])
Félix-Antoine Fortin
@cmd-ntrf
@johnmee You are correct. The documentation was probably written before we introduced the reversed in the code. I have created an issue DEAP/deap#80.
John Mee
@johnmee
@cmd-ntrf Thanks. I even commenced putting together a docs pull request for it, until I realised I'm on py3, and I haven't got a py2 handy. Apologies: +1 for trying; -1 for not trying very hard ;-)
Ian Bell
@ibell
Anyone know whether you can somehow hack algorithms.eaSimple to stop the optimization when the evolution has stagnated/reached its solution? I'd rather it stopped when it reaches the solution after 5 generations rather than continue on to the max number of generations, without improving the solution at all. Ideally, there would be a stopping condition callback that you could provide.
Félix-Antoine Fortin
@cmd-ntrf
@johnmee Why would you need py2?
@ibell We have been scratching our heads with stopping criterion in DEAP algorithms and we have yet found an elegant way to proceed. So far, we have recommended copying the algorithm and add the stopping condition. It is far from ideal, but we think it is better than a clumsy API.
John Mee
@johnmee
@cmd-ntrf When I did make html for the docs/sphinx it spat out a zillion warnings that bemoaned you need to upgrade this chunk of code to python 3—the change in syntax of around exceptions was particularly noisy. Then I realised that to install on py3 it is actually py2 code run through 2to3? I probably could get away with a documentation change, but to squelch all the warnings and just wing it—tendering a pull request which had not actually been tested on py2—was all the discouragement I needed.
Félix-Antoine Fortin
@cmd-ntrf

@johnmee Sorry you got discouraged. I have observed what you described and have open a new issue on that matter DEAP/deap#81.

There is not much code left in DEAP that is out of the box incompatible with Python 3, and for documentation compilation the two culprits are print and exception. Print can be addressed easily, exception not so much.

eouti
@eouti
Hi, congrats for this nice framework. I started to play around with nsga2 and basic optimization problems, it is great. Now i'd like to hack into more realistic optimization problem. Indeed, instead of list of floats, i'd like my individuals to have a custom model. Then, i need to implement the corresponding crossover, mutates... I also need to formalize the optimization problem. Any example on custom individual model and how to deal with it? I searched the web and this is this only relevant topic i found similar to my needs: https://groups.google.com/forum/#!msg/deap-users/KZYYHCGrFyY/x1nXcXpCyscJ
François-Michel De Rainville
@fmder
@eouti Thanks for the kind words. Usually, the transfer between the usual float vector optimization and a more realistic model is done through a genotypic <=> phenotypic translation. On the first hand, the phenotype is used for evaluation. It is the complex object that is the answer to your problem. The genotype, on the other hand, is the simpler object that is manipulated by the optimization algorithm. Since programmer time is much more costly than machine time, a translation phase in the evaluation function between a simple vector representation and your model is the ideal case. It will save you time and you will be able to use already implemented (and tested!) operators. Just as example, instead of trying to optimize a permutation of prime numbers, it is much simpler to optimize a permutation of integers (say [0, 1, 2, 3]) and, at evaluation time, translate them to primes using their index ([2, 3, 5, 7]). You can most often do the same with floats vectors.
John Mee
@johnmee

Hello again.

I'm having "fun" with the ADF's. We're following a strict Kosa model of ADF's and Result Producing Branch (RPB), and I've had no great problems implementing dynamic numbers of ADF's in each individual such that the RPB calls the ADF's.

But I'm having difficulty getting the ADF's to refer to each other (laying them out hierarchically such that ADF0pset = primitives, ADF1pset = primitives + ADF0, ADF2pset = prims + ADF1 + ADF0... etc.) I don't see why it wouldn't work, but given how much trouble I'm having getting it right I'm starting to wonder...

  1. Am I wasting my time? If I can actually get the psets arranged correctly will the ADF's call each other?
  2. For the compilation of the expression, rather than lambdify-ing it, has anyone ventured into trying to use the AST module in conjuction with deap?

Thx

John Mee
@johnmee
Sorry for the noise, but disregard the first question: answer is 'yes it will work, no, not wasting my time', but still interested in anything relating to the second question (using AST).
Félix-Antoine Fortin
@cmd-ntrf

@johnmee We have tried in the past to use AST module to compile GP expressions, multiple times. Each try had the same conclusion: it is slower to use AST. That said, each time we looked at AST was with the objective of reducing compile time.

The most promising solutions we have so far to improve compilation performance are using PyPy and compiling trees to bytecode directly. @mgard did some experiments with bytecode and Python, but his code has not found its way in deap's core yet. I think you can find some of his work in his deap fork.

However, you might have something else in mind when asking about AST.

mwmajewsk
@mmajewsk
hi, is deap still in developement ?
Félix-Antoine Fortin
@cmd-ntrf
@hawkerpl Of course, what would make you think otherwise?
mwmajewsk
@mmajewsk
@cmd-ntrf i just wanted to be sure
John Mee
@johnmee
@cmd-ntrf No worries, I was exploring AST for a solution to my issues getting ADF's to call each other, and thought, in addition to working, it might also provide evolution that is more granular and flexible. After a little profiling, I can see, not surprisingly, it spends most (all) of the cpu time evaluating (running) generated programs, so anything to keep that to minimum is justified. Thx for your support!
mwmajewsk
@mmajewsk
i have silly questions: why is deap written practically in not object oriented way, and why does it not follow pep8 ?
( i mean camelCase and no under_score)
François-Michel De Rainville
@fmder

@hawkerpl Object oriented is not the solution to everything. We think that functions provide much more flexibility for the algorithms and operators. Note that we use classes at many (usefull) places and even use functions as objects. We simply don't force the use of objects where it is not convenient.

For the camelCase, we chose this style because we thought it made a better separation between the prefix (cx, mut, sel, ...) than underscores: two_point_crossover() looks kinda weird.

mwmajewsk
@mmajewsk
@fmder ok, thx
Shivam Kalra
@shivamkalra
This message was deleted