Daniel@0: Daniel@0:
Daniel@0:Daniel@0: Daniel@0: net = somtrain{net, options, x) Daniel@0:Daniel@0: Daniel@0: Daniel@0:
net = somtrain{net, options, x)
uses Kohonen's algorithm to
Daniel@0: train a SOM. Both on-line and batch algorithms are implemented.
Daniel@0: The learning rate (for on-line) and neighbourhood size decay linearly.
Daniel@0: There is no error function minimised during training (so there is
Daniel@0: no termination criterion other than the number of epochs), but the
Daniel@0: sum-of-squares is computed and returned in options(8)
.
Daniel@0:
Daniel@0: The optional parameters have the following interpretations. Daniel@0: Daniel@0:
options(1)
is set to 1 to display error values; also logs learning
Daniel@0: rate alpha
and neighbourhood size nsize
.
Daniel@0: Otherwise nothing is displayed.
Daniel@0:
Daniel@0:
options(5)
determines whether the patterns are sampled randomly
Daniel@0: with replacement. If it is 0 (the default), then patterns are sampled
Daniel@0: in order. This is only relevant to the on-line algorithm.
Daniel@0:
Daniel@0:
options(6)
determines if the on-line or batch algorithm is
Daniel@0: used. If it is 1
Daniel@0: then the batch algorithm is used. If it is 0
Daniel@0: (the default) then the on-line algorithm is used.
Daniel@0:
Daniel@0:
options(14)
is the maximum number of iterations (passes through
Daniel@0: the complete pattern set); default 100.
Daniel@0:
Daniel@0:
options(15)
is the final neighbourhood size; default value is the
Daniel@0: same as the initial neighbourhood size.
Daniel@0:
Daniel@0:
options(16)
is the final learning rate; default value is the same
Daniel@0: as the initial learning rate.
Daniel@0:
Daniel@0:
options(17)
is the initial neighbourhood size; default 0.5*maximum
Daniel@0: map size.
Daniel@0:
Daniel@0:
options(18)
is the initial learning rate; default 0.9. This parameter
Daniel@0: must be positive.
Daniel@0:
Daniel@0:
Daniel@0: Daniel@0: net = som(nin, [8, 7]); Daniel@0: options = foptions; Daniel@0: Daniel@0:Daniel@0: Daniel@0: Daniel@0:% Ordering phase Daniel@0: options(1) = 1; Daniel@0: options(14) = 50; Daniel@0: options(18) = 0.9; % Initial learning rate Daniel@0: options(16) = 0.05; % Final learning rate Daniel@0: options(17) = 8; % Initial neighbourhood size Daniel@0: options(15) = 1; % Final neighbourhood size Daniel@0: net2 = somtrain(net, options, x); Daniel@0: Daniel@0:
% Convergence phase Daniel@0: options(14) = 400; Daniel@0: options(18) = 0.05; Daniel@0: options(16) = 0.01; Daniel@0: options(17) = 0; Daniel@0: options(15) = 0; Daniel@0: net3 = somtrain(net2, options, x); Daniel@0:
kmeans
, som
, somfwd
Copyright (c) Ian T Nabney (1996-9) Daniel@0: Daniel@0: Daniel@0: Daniel@0: