comparison toolboxes/FullBNT-1.0.7/netlab3.3/gtmlmode.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function modes = gtmlmode(net, data)
2 %GTMLMODE Mode responsibility for data in a GTM.
3 %
4 % Description
5 % MODES = GTMLMODE(NET, DATA) takes a GTM structure NET, and computes
6 % the modes of the responsibility distributions for each data point in
7 % DATA. These will always lie at one of the latent space sample points
8 % NET.X.
9 %
10 % See also
11 % GTM, GTMPOST, GTMLMEAN
12 %
13
14 % Copyright (c) Ian T Nabney (1996-2001)
15
16 % Check for consistency
17 errstring = consist(net, 'gtm', data);
18 if ~isempty(errstring)
19 error(errstring);
20 end
21
22 R = gtmpost(net, data);
23 % Mode is maximum responsibility
24 [max_resp, max_index] = max(R, [], 2);
25 modes = net.X(max_index, :);