annotate toolboxes/FullBNT-1.0.7/netlab3.3/gtmmag.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 mags = gtmmag(net, latent_data)
wolffd@0 2 %GTMMAG Magnification factors for a GTM
wolffd@0 3 %
wolffd@0 4 % Description
wolffd@0 5 % MAGS = GTMMAG(NET, LATENTDATA) takes a GTM structure NET, and
wolffd@0 6 % computes the magnification factors for each point the latent space
wolffd@0 7 % contained in LATENTDATA.
wolffd@0 8 %
wolffd@0 9 % See also
wolffd@0 10 % GTM, GTMPOST, GTMLMEAN
wolffd@0 11 %
wolffd@0 12
wolffd@0 13 % Copyright (c) Ian T Nabney (1996-2001)
wolffd@0 14
wolffd@0 15 errstring = consist(net, 'gtm');
wolffd@0 16 if ~isempty(errstring)
wolffd@0 17 error(errstring);
wolffd@0 18 end
wolffd@0 19
wolffd@0 20 Jacs = rbfjacob(net.rbfnet, latent_data);
wolffd@0 21 nlatent = size(latent_data, 1);
wolffd@0 22 mags = zeros(nlatent, 1);
wolffd@0 23 temp = zeros(net.rbfnet.nin, net.rbfnet.nout);
wolffd@0 24 for m = 1:nlatent
wolffd@0 25 temp = squeeze(Jacs(m, :, :)); % Turn into a 2d matrix
wolffd@0 26 mags(m) = sqrt(det(temp*temp'));
wolffd@0 27 end