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