Genetic algorithm example/tutorial for PyBrain?
Asked Answered
I

2

8

I have recently started using pyBrain to conduct some machine learning research. I am interested in GAs as well as ANNs - however despit the fact that the pyBrain homepage lists GA as one of the features of the library, there does not seem to be anything in the pyBrain documentation on GA programming (e.g. chromosome selection, fitness functions etc), and there are no examples involving GA on the PyBrain site (AFAIK).

Also, equally suprising is that all my searches to find GA examples using PyBrain have also, yielded nothing. Does anyone have a link to code that shows a GA example using pyBrain?

Inroad answered 6/1, 2012 at 11:57 Comment(2)
did you find a solution or something that can help? I am lost in the official documentationWasson
#15752223Karlik
K
5

PyBrain is a very extensive library, and its focus effectively appears to be around Neural Nets rather than optimization algorithms at large. This focus is in part reflected by the topics of most scholarly papers which make references to PyBrain.

Never the less GAs are supported in PyBrain through the Evolvable abstract class which is minimally described in the documentation page about Black-box Optimization

You are however apparently correct in your assertion that there are no PyBrain-based GA examples to be found on the Internet. The few applicable references to the Evolvable keyword for example all point to repositories of PyBrain library's own source code and minimalist examples or unit-tests...

The fact is that PyBrain is still -pun unintended- evolving; its current version is 0.3, a fair warning to would be adopters, but there appears to be enough interest and activity around the library to indicate that it could mature to be a respectable tool.

Kristianson answered 7/1, 2012 at 3:2 Comment(0)
V
1

Here's one.

def objF(x): return sum(x**2)
x0 = array([2.1, -1])

l = CMAES(objF, x0)
l.minimize = True
l.maxEvaluations = 200
l.learn()
Verda answered 21/7, 2018 at 8:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.