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