bartek
bartek

Reputation: 3011

python neurolab feed forward neural network

Could anyone explain to me how to use this library:

http://code.google.com/p/neurolab/

to create a Neural Network that follows these rules:

  1. Feed forward multilayer:3 layers, 225 inputs, 50 hidden and 10 output

    (because input is 15x15 black/white image, ouput is 10 digits)

  2. Back error propagation

I have problem with installing PyBrain on OSX, maybe in this will be easier.

Upvotes: 2

Views: 7533

Answers (1)

comm
comm

Reputation: 34

Some that: import numpy as np

import neurolab as nl

input = np.random.uniform(0, 0.1, (1000, 225))
output = input[:,:10] + input[:,10:20]
# 2 layers with 225 inputs 50 neurons in hidden\input layer and 10 in output
# for 3 layers use some thet: nl.net.newff([[0, .1]]*225, [50, 40, 10])
net = nl.net.newff([[0, .1]]*225, [50, 10])
net.trainf = nl.train.train_bfgs

e = net.train(input, output, show=1, epochs=100, goal=0.0001)

see example http://packages.python.org/neurolab/ex_newff.html and doc: http://packages.python.org/neurolab/lib.html#neurolab.train.train_bfgs

Upvotes: 1

Related Questions