comparison toolboxes/FullBNT-1.0.7/netlab3.3/demhint.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function demhint(nin, nhidden, nout)
2 %DEMHINT Demonstration of Hinton diagram for 2-layer feed-forward network.
3 %
4 % Description
5 %
6 % DEMHINT plots a Hinton diagram for a 2-layer feedforward network with
7 % 5 inputs, 4 hidden units and 3 outputs. The weight vector is chosen
8 % from a Gaussian distribution as described under MLP.
9 %
10 % DEMHINT(NIN, NHIDDEN, NOUT) allows the user to specify the number of
11 % inputs, hidden units and outputs.
12 %
13 % See also
14 % HINTON, HINTMAT, MLP, MLPPAK, MLPUNPAK
15 %
16
17 % Copyright (c) Ian T Nabney (1996-2001)
18
19 if nargin < 1 nin = 5; end
20 if nargin < 2 nhidden = 7; end
21 if nargin < 3 nout = 3; end
22
23 % Fix the seed for reproducible results
24 randn('state', 42);
25 clc
26 disp('This demonstration illustrates the plotting of Hinton diagrams')
27 disp('for Multi-Layer Perceptron networks.')
28 disp(' ')
29 disp('Press any key to continue.')
30 pause
31 net = mlp(nin, nhidden, nout, 'linear');
32
33 [h1, h2] = mlphint(net);
34 clc
35 disp('The MLP has been created with')
36 disp([' ' int2str(nin) ' inputs'])
37 disp([' ' int2str(nhidden) ' hidden units'])
38 disp([' ' int2str(nout) ' outputs'])
39 disp(' ')
40 disp('One figure is produced for each layer of weights.')
41 disp('For each layer the fan-in weights are arranged in rows for each unit.')
42 disp('The bias weight is separated from the rest by a red vertical line.')
43 disp('The area of each box is proportional to the weight value: positive')
44 disp('values are white, and negative are black.')
45 disp(' ')
46 disp('Press any key to exit.');
47 pause;
48 delete(h1);
49 delete(h2);