wolffd@0: function [post, a] = mdnpost(mixparams, t) wolffd@0: %MDNPOST Computes the posterior probability for each MDN mixture component. wolffd@0: % wolffd@0: % Description wolffd@0: % POST = MDNPOST(MIXPARAMS, T) computes the posterior probability wolffd@0: % P(J|T) of each data vector in T under the Gaussian mixture model wolffd@0: % represented by the corresponding entries in MIXPARAMS. Each row of T wolffd@0: % represents a single vector. wolffd@0: % wolffd@0: % [POST, A] = MDNPOST(MIXPARAMS, T) also computes the activations A wolffd@0: % (i.e. the probability P(T|J) of the data conditioned on each wolffd@0: % component density) for a Gaussian mixture model. wolffd@0: % wolffd@0: % See also wolffd@0: % MDNGRAD, MDNPROB wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: % David J Evans (1998) wolffd@0: wolffd@0: [prob a] = mdnprob(mixparams, t); wolffd@0: wolffd@0: s = sum(prob, 2); wolffd@0: % Set any zeros to one before dividing wolffd@0: s = s + (s==0); wolffd@0: post = prob./(s*ones(1, mixparams.ncentres));