function [hme] = hmeCreate(levels,b,d,k) % [hme] = hmeCreate(levels,b,d,k) % % Create balanced-tree HME model. % The model parameters are initialized to zero. % % INPUTS % levels number of levels (>=0) in hierarchy % b branching factor % d dimensionality of data % k number of classes % % OUTPUTS % hme HME model % % See also hmeCreateExpert, hmeCreateMixture, hmeInitRand, % hmeInitLR. % % David Martin % Charless Fowlkes % May 7, 2002 % Copyright (C) 2002 David R. Martin % Copyright (C) 2002 Charless C. Fowlkes % % This program is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 2 of the % License, or (at your option) any later version. % % This program is distributed in the hope that it will be useful, but % WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA % 02111-1307, USA, or see http://www.gnu.org/copyleft/gpl.html. if levels == 0, hme = hmeCreateExpert(d,k); else children = cell(1,b); for i = 1:b, children{i} = hmeCreate(levels-1,b,d,k); end hme = hmeCreateMixture(children,d); end