Intro 2 Netlab
Intro 2 Netlab
Intro 2 Netlab
• Available from:
http://www.ncrg.aston.ac.uk/netlab/index.php
– nin=number of inputs
– nhidden=number of hidden units
– nout=number of outputs
– act_function= name of activation function for the
output layer (a string):
'linear', 'logistic', or 'softmax'
>> net=mlp(2,3,1,'logistic')
type: 'mlp'
nin: 2
nhidden: 3
nout: 1
nwts: 13
outfn: 'logistic'
w1: [2x3 double]
b1: [-0.2661 -0.0117 -0.0266]
w2: [3x1 double]
b2: 0.3873
Neural Networks 3
Creating Multilayer Perceptrons: Example
We may access and modify all the fields using the "."
operator.
E.g.:
>> a=net.w1
a=
0.5107 0.7603 0.8469
1.4655 0.8327 -0.6392
>>net.w1=rand(2,3);
Neural Networks 4
Applying the network to data
>> a=mlpfwd(net, x)
applies the network net to input data x (input
patterns are rows of x; x has to have net.nin
columns)
>>error=mlperr(net, x, t)
calculates error of network net, applied to input data
x, and desired outputs (targets) t
Neural Networks 5
Training MLP
y = glmfwd(net, x)
apply the model to data x
error = glmerr(net, x, t)
calculate the error
softmax:
the outputs of the net should sum-up to 1, so they
can be interpreted as probabilities; check on
http://www.faqs.org/faqs/ai-faq/neural-nets/part2/section-12.html
IRLS: http://en.wikipedia.org/wiki/IRLS
Neural Networks 9
To do:
Neural Networks 10