d.addSample([0.0, 0.0], [0.0])
d.addSample([0.0, 1.0], [1.0])
d.addSample([1.0, 0.0], [1.0])
d.addSample([1.0, 1.0], [0.0])
d.setField('class', [[0.0], [1.0], [1.0], [0.0]])
nn = buildNetwork(2, 3, 1)
ga = GA(d.evaluateModuleMSE, nn, minimize=True)
for i in range(100):
    nn = ga.learn(0)[0]
How to train a neural network to supervised data set using pybrain black-box optimization?