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