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