Training Fails for Non-Default Activation Functions
GoogleCodeExporter opened this issue · comments
I've modified the example for how to use a feed forward network by passing an
argument to the newff function.
import neurolab as nl
import numpy as np
# Create train samples
x = np.linspace(-7, 7, 20)
y = np.sin(x) * 0.5
size = len(x)
inp = x.reshape(size,1)
tar = y.reshape(size,1)
# Create network with 2 layers and random initialized
net = nl.net.newff([[-7, 7]],[5, 1], transf=[nl.net.trans.LogSig]*2)
# Train network
error = net.train(inp, tar, epochs=500, show=100, goal=0.02)
Original issue reported on code.google.com by MLotst...@gmail.com
on 8 Jun 2014 at 7:31
transf gets list of functions, not a classes:
net = nl.net.newff([[-7, 7]],[5, 1], transf=[nl.net.trans.LogSig()]*2)
Original comment by zue...@gmail.com
on 9 Jun 2014 at 4:38
- Changed state: Invalid