Mercurial > hg > camir-ismir2012
annotate toolboxes/FullBNT-1.0.7/netlab3.3/rbfsetfw.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 net = rbfsetfw(net, scale) |
Daniel@0 | 2 %RBFSETFW Set basis function widths of RBF. |
Daniel@0 | 3 % |
Daniel@0 | 4 % Description |
Daniel@0 | 5 % NET = RBFSETFW(NET, SCALE) sets the widths of the basis functions of |
Daniel@0 | 6 % the RBF network NET. If Gaussian basis functions are used, then the |
Daniel@0 | 7 % variances are set to the largest squared distance between centres if |
Daniel@0 | 8 % SCALE is non-positive and SCALE times the mean distance of each |
Daniel@0 | 9 % centre to its nearest neighbour if SCALE is positive. Non-Gaussian |
Daniel@0 | 10 % basis functions do not have a width. |
Daniel@0 | 11 % |
Daniel@0 | 12 % See also |
Daniel@0 | 13 % RBFTRAIN, RBFSETBF, GMMEM |
Daniel@0 | 14 % |
Daniel@0 | 15 |
Daniel@0 | 16 % Copyright (c) Ian T Nabney (1996-2001) |
Daniel@0 | 17 |
Daniel@0 | 18 % Set the variances to be the largest squared distance between centres |
Daniel@0 | 19 if strcmp(net.actfn, 'gaussian') |
Daniel@0 | 20 cdist = dist2(net.c, net.c); |
Daniel@0 | 21 if scale > 0.0 |
Daniel@0 | 22 % Set variance of basis to be scale times average |
Daniel@0 | 23 % distance to nearest neighbour |
Daniel@0 | 24 cdist = cdist + realmax*eye(net.nhidden); |
Daniel@0 | 25 widths = scale*mean(min(cdist)); |
Daniel@0 | 26 else |
Daniel@0 | 27 widths = max(max(cdist)); |
Daniel@0 | 28 end |
Daniel@0 | 29 net.wi = widths * ones(size(net.wi)); |
Daniel@0 | 30 end |