wolffd@0: function modes = gtmlmode(net, data) wolffd@0: %GTMLMODE Mode responsibility for data in a GTM. wolffd@0: % wolffd@0: % Description wolffd@0: % MODES = GTMLMODE(NET, DATA) takes a GTM structure NET, and computes wolffd@0: % the modes of the responsibility distributions for each data point in wolffd@0: % DATA. These will always lie at one of the latent space sample points wolffd@0: % NET.X. 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: % Check for consistency wolffd@0: errstring = consist(net, 'gtm', data); wolffd@0: if ~isempty(errstring) wolffd@0: error(errstring); wolffd@0: end wolffd@0: wolffd@0: R = gtmpost(net, data); wolffd@0: % Mode is maximum responsibility wolffd@0: [max_resp, max_index] = max(R, [], 2); wolffd@0: modes = net.X(max_index, :);