comparison toolboxes/FullBNT-1.0.7/netlab3.3/mdnpost.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 [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));