wolffd@0: function net = rbfsetfw(net, scale) wolffd@0: %RBFSETFW Set basis function widths of RBF. wolffd@0: % wolffd@0: % Description wolffd@0: % NET = RBFSETFW(NET, SCALE) sets the widths of the basis functions of wolffd@0: % the RBF network NET. If Gaussian basis functions are used, then the wolffd@0: % variances are set to the largest squared distance between centres if wolffd@0: % SCALE is non-positive and SCALE times the mean distance of each wolffd@0: % centre to its nearest neighbour if SCALE is positive. Non-Gaussian wolffd@0: % basis functions do not have a width. wolffd@0: % wolffd@0: % See also wolffd@0: % RBFTRAIN, RBFSETBF, GMMEM wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: wolffd@0: % Set the variances to be the largest squared distance between centres wolffd@0: if strcmp(net.actfn, 'gaussian') wolffd@0: cdist = dist2(net.c, net.c); wolffd@0: if scale > 0.0 wolffd@0: % Set variance of basis to be scale times average wolffd@0: % distance to nearest neighbour wolffd@0: cdist = cdist + realmax*eye(net.nhidden); wolffd@0: widths = scale*mean(min(cdist)); wolffd@0: else wolffd@0: widths = max(max(cdist)); wolffd@0: end wolffd@0: net.wi = widths * ones(size(net.wi)); wolffd@0: end