I have played around a bit with pybrain and understand how to generate neural networks with custom architectures and train them to supervised data sets using backpropagation algorithm.
However I am confused by the optimization algorithms and the concepts of tasks, learning agents and environments.
For example: How would I implement a neural network such as (1) to classify the XOR dataset using pybrain genetic algorithm (2)?
(1) pybrain.tools.shortcuts.buildNetwork(2, 3, 1)
(2) pybrain.optimization.GA()
I finally worked it out!! Its always easy once you know how!
Essentially the first arg to the GA is the fitness function (called evaluator in docs) which must take the second argument (an individual, called evaluable in docs) as its only arg.
In this example will train to XOR
Test results after the above script: