annotate toolboxes/FullBNT-1.0.7/HMM/mhmmParzen_train_observed.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 [initState, transmat, mu, Nproto, pick] = mhmmParzen_train_observed(obsData, hiddenData, ...
Daniel@0 2 nstates, maxNproto, varargin)
Daniel@0 3 % mhmmParzentrain_observed with mixture of Gaussian outputs from fully observed sequences
Daniel@0 4 % function [initState, transmat, mu, Nproto] = mhmm_train_observed_parzen(obsData, hiddenData, ...
Daniel@0 5 % nstates, maxNproto)
Daniel@0 6 %
Daniel@0 7 %
Daniel@0 8 % INPUT
Daniel@0 9 % If all sequences have the same length
Daniel@0 10 % obsData(:,t,ex)
Daniel@0 11 % hiddenData(ex,t) - must be ROW vector if only one sequence
Daniel@0 12 % If sequences have different lengths, we use cell arrays
Daniel@0 13 % obsData{ex}(:,t)
Daniel@0 14 % hiddenData{ex}(t)
Daniel@0 15 %
Daniel@0 16 % Optional argumnets
Daniel@0 17 % dirichletPriorWeight - for smoothing transition matrix counts
Daniel@0 18 % mkSymmetric
Daniel@0 19 %
Daniel@0 20 % Output
Daniel@0 21 % mu(:,q)
Daniel@0 22 % Nproto(q) is the number of prototypes (mixture components) chosen for state q
Daniel@0 23
Daniel@0 24 [transmat, initState] = transmat_train_observed(...
Daniel@0 25 hiddenData, nstates, varargin{:});
Daniel@0 26
Daniel@0 27 % convert to obsData(:,t*nex)
Daniel@0 28 if ~iscell(obsData)
Daniel@0 29 [D T Nex] = size(obsData);
Daniel@0 30 obsData = reshape(obsData, D, T*Nex);
Daniel@0 31 else
Daniel@0 32 obsData = cat(2, obsData{:});
Daniel@0 33 hiddenData = cat(2, hiddenData{:});
Daniel@0 34 end
Daniel@0 35 [mu, Nproto, pick] = parzen_fit_select_unif(obsData, hiddenData(:), maxNproto);
Daniel@0 36
Daniel@0 37