wolffd@0: function mags = gtmmag(net, latent_data) wolffd@0: %GTMMAG Magnification factors for a GTM wolffd@0: % wolffd@0: % Description wolffd@0: % MAGS = GTMMAG(NET, LATENTDATA) takes a GTM structure NET, and wolffd@0: % computes the magnification factors for each point the latent space wolffd@0: % contained in LATENTDATA. wolffd@0: % wolffd@0: % See also wolffd@0: % GTM, GTMPOST, GTMLMEAN wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: wolffd@0: errstring = consist(net, 'gtm'); wolffd@0: if ~isempty(errstring) wolffd@0: error(errstring); wolffd@0: end wolffd@0: wolffd@0: Jacs = rbfjacob(net.rbfnet, latent_data); wolffd@0: nlatent = size(latent_data, 1); wolffd@0: mags = zeros(nlatent, 1); wolffd@0: temp = zeros(net.rbfnet.nin, net.rbfnet.nout); wolffd@0: for m = 1:nlatent wolffd@0: temp = squeeze(Jacs(m, :, :)); % Turn into a 2d matrix wolffd@0: mags(m) = sqrt(det(temp*temp')); wolffd@0: end