comparison toolboxes/FullBNT-1.0.7/netlab3.3/mdnpost.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 [post, a] = mdnpost(mixparams, t)
2 %MDNPOST Computes the posterior probability for each MDN mixture component.
3 %
4 % Description
5 % POST = MDNPOST(MIXPARAMS, T) computes the posterior probability
6 % P(J|T) of each data vector in T under the Gaussian mixture model
7 % represented by the corresponding entries in MIXPARAMS. Each row of T
8 % represents a single vector.
9 %
10 % [POST, A] = MDNPOST(MIXPARAMS, T) also computes the activations A
11 % (i.e. the probability P(T|J) of the data conditioned on each
12 % component density) for a Gaussian mixture model.
13 %
14 % See also
15 % MDNGRAD, MDNPROB
16 %
17
18 % Copyright (c) Ian T Nabney (1996-2001)
19 % David J Evans (1998)
20
21 [prob a] = mdnprob(mixparams, t);
22
23 s = sum(prob, 2);
24 % Set any zeros to one before dividing
25 s = s + (s==0);
26 post = prob./(s*ones(1, mixparams.ncentres));