[mlpack-svn] [MLPACK] #271: SaveRestoreUtility and hierarchical model support
MLPACK Trac
trac at coffeetalk-1.cc.gatech.edu
Wed Apr 3 15:32:17 EDT 2013
#271: SaveRestoreUtility and hierarchical model support
-------------------------+--------------------------------------------------
Reporter: rcurtin | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: mlpack 1.1.0
Component: mlpack | Keywords: xml, saverestoreutility, hierarchical models, load, save, model
Blocking: | Blocked By:
-------------------------+--------------------------------------------------
Currently the SaveRestoreUtility does a great job of loading elements from
XML files as long as you have the full path to the object. But suppose we
have some HMM with Gaussian emissions:
{{{
<hmm>
<dimensionality>5</dimensionality>
<emissions>2</emissions>
<emission0>
<mean> ... </mean>
<covariance> ... </covariance>
</emission0>
<emission1>
<mean> ... </mean>
<covariance> ... </covariance>
</emission1>
<transition> ... </transition>
</hmm>
}}}
Each emission contains exactly what GaussianDistribution::Save() (which is
not yet written) would output into a file. So HMM::Save() should
internally use GaussianDistribution::Save() (and HMM::Load() should
internally use GaussianDistribution::Load()) but that means that we need
to have some XMLNode class (or something similar) so that we can do
something like
{{{
HMM<GaussianDistribution>::Load(XMLNode& node)
{
node.LoadParameter(transition, "transition");
size_t numEmissions;
node.LoadParameter(numEmissions, "emissions");
node.LoadParameter(dimensionality);
emissions.resize(numEmissions, GaussianDistribution(dimensionality));
for (size_t i = 0; i < numEmissions; ++i)
{
emissions[i].Load("emission" + i); // yes, this is just psuedocode
}
}
}}}
Neil, I cc'ed you on this ticket in case you have any ideas (feel free to
remove yourself). I think it should be a fairly simple refactoring. I
also think maybe it should be 'ModelNode' not 'XMLNode' so that we can
later load things that aren't XML.
--
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/271>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed by the FASTLAB at Georgia Tech under Dr. Alex Gray.
More information about the mlpack-svn
mailing list