annotate toolboxes/FullBNT-1.0.7/netlab3.3/rbfsetfw.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function net = rbfsetfw(net, scale)
wolffd@0 2 %RBFSETFW Set basis function widths of RBF.
wolffd@0 3 %
wolffd@0 4 % Description
wolffd@0 5 % NET = RBFSETFW(NET, SCALE) sets the widths of the basis functions of
wolffd@0 6 % the RBF network NET. If Gaussian basis functions are used, then the
wolffd@0 7 % variances are set to the largest squared distance between centres if
wolffd@0 8 % SCALE is non-positive and SCALE times the mean distance of each
wolffd@0 9 % centre to its nearest neighbour if SCALE is positive. Non-Gaussian
wolffd@0 10 % basis functions do not have a width.
wolffd@0 11 %
wolffd@0 12 % See also
wolffd@0 13 % RBFTRAIN, RBFSETBF, GMMEM
wolffd@0 14 %
wolffd@0 15
wolffd@0 16 % Copyright (c) Ian T Nabney (1996-2001)
wolffd@0 17
wolffd@0 18 % Set the variances to be the largest squared distance between centres
wolffd@0 19 if strcmp(net.actfn, 'gaussian')
wolffd@0 20 cdist = dist2(net.c, net.c);
wolffd@0 21 if scale > 0.0
wolffd@0 22 % Set variance of basis to be scale times average
wolffd@0 23 % distance to nearest neighbour
wolffd@0 24 cdist = cdist + realmax*eye(net.nhidden);
wolffd@0 25 widths = scale*mean(min(cdist));
wolffd@0 26 else
wolffd@0 27 widths = max(max(cdist));
wolffd@0 28 end
wolffd@0 29 net.wi = widths * ones(size(net.wi));
wolffd@0 30 end