annotate toolboxes/FullBNT-1.0.7/netlab3.3/demhint.m @ 0:cc4b1211e677 tip

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