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