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

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
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, :);