Library: | nn |
See also: | nnrpredict ann |
Quantlet: | nnrnet | |
Description: | trains a one hidden layer feed forward network. The optional parameter param consists of 8 values. Boolean values for linear output, entropy error function, log probability models and for skip connections. The fifth value is the maximum value for the starting weights, the sixth the weight decay, the seventh the number of maximal iterations and the last value generates some output if equal to one. |
Usage: | net=nnrnet (x, y, weights, size{, param {, wts}}) | |
Input: | ||
x | n x p matrix input variables | |
y | n x q matrix output variables | |
weights | n x 1 vector of weights | |
size | scalar number of hidden units | |
param | 7 x 1 vector of parameters | |
wts | vector of predefined weights | |
Output: | ||
net.n | 3 x 1 vector number of input, hidden and output units | |
net.nunits | scalar | |
net.nconn | vector | |
net.conn | vector | |
net.decay | scalar weight decay parameter | |
net.entropy | scalar | |
net.softmax | scalar | |
net.value | scalar value of error function | |
net.wts | vector of weights | |
net.yh | n x q estimated y's |
library("nn") x = read("bank2") y =(1:rows(x)).>100 x =(x-min(x))./(max(x)-min(x)) par = 0|1|0|1|0.7|1.0e-3|1500|0 net = nnrnet(x, y, matrix(rows(x)), 10, par)
runs a neural network with 10 hidden units for the swiss banknote data (1 forged banknote, 0 genuine banknote).