<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="StatisticalModelAdaptation" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>
name:
<a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h">StatisticalModelAdaptation</a>
</b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>
<br><br>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_pr.a

#include &lt;StatisticalModelAdaptation.h&gt;

StatisticalModelAdaptation(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, float split_threshold, float merge_threshold, float num_occ_threshold);
boolean eq(const StatisticalModelAdaptation& arg);
boolean setAlgorithm(ALGORITHM algorithm);
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
StatisticalModelAdaptation smadp;
smadp.setAlgorithm(MLLR);
smadp.setImplementation(MEAN);
      
smadp.adapt(RegressionDecisionTree& rdt_a, Vector& stat_models_a);

</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

The StatisticalModelAdaptation class is used to solve the problem of sparse
data by tying Statistical Models using the training data (Symbol
Occupancies) and the Regression questions (expert knowledge).  A good
reference of the algorithm is:

<ul>
  J. Zhao, et al,,
  <a href="http://www.isip.msstate.edu/publications/reports/isip_lvcsr/1999/decision_tree/doc/ report_061599.pdf">
  "Tutorial for Decision Tree-Based State-Tying For Acoustic Modeling"</a>, September 1993.
</ul>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../RegressionDecisionTreeNode/index.html">RegressionDecisionTreeNode</a>
  <li> <a href="../RegressionDecisionTree/index.html">RegressionDecisionTree</a>
  <li> <a href="../../stat/StatisticalModel/index.html">StatisticalModel</a>
  <li> <a href="../../stat/GaussianModel/index.html">GaussianModel</a>
  <li> <a href="../../stat/MixtureModel/index.html">MixtureModel</a>
  <li> <a href="../../dstr/BiGraphArc/index.html">BiGraphArc</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"StatisticalModelAdaptation";</a></pre>
       
  <li> define the algorithm choices:

       <pre>enum ALGORITHM { MLLR = 0, MAP, DEF_ALGORITHM = MLLR };</pre>

  <li> define the implementation choices:

       <pre>enum IMPLEMENTATION { MEAN = 0, VARIANCE, DEF_IMPLEMENTATION = MEAN };</pre>

  <li> define the static NameMap objects:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=ALGO_MAP">static const NameMap ALGO_MAP(L"MLLR MAP");</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=IMPL_MAP">static const NameMap IMPL_MAP(L"MEAN VARIANCE");</a></pre>

  <li> define i/o related constants:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=DEF_PARAM">static const String DEF_PARAM = L"";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=PARAM_ALGORITHM">static const String PARAM_ALGORITHM = L"algorithm";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=PARAM_IMPLEMENTATION">static const String PARAM_IMPLEMENTATION = L"implementation";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&constant=PARAM_DBGL">static const String PARAM_IMPLEMENTATION = L"debug_level";</a></pre>              

</ul>

<a name="error">
<b>error codes:</b>
<br><br>

<ul>
  <li> error code indicating StatisticalModelAdaptation class general error:

       <pre><a href="/perl/ifc_document.pl?err=00100750">static const long ERR = 00100750;</a></pre>
       <pre><a href="/perl/ifc_document.pl?err=00100751">static const long ERR = 00100751;</a></pre>       
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>
  <li> define the structures:
       
       <pre>typedef BiGraphVertex&lt;RegressionDecisionTreeNode&gt; TreeNode;</pre>

  <li> algorithm name:

       <pre>ALGORITHM algorithm_d;</pre>

  <li> implmentation name:

       <pre>IMPLEMENTATION implementation_d;</pre>

  <li> define transformation matrix W (one row for each Gaussian dimension)

       <pre>Vector<VectorFloat> w_transform_d;</pre>

  <li> debugging level
       
       <pre>debug_level_d;</pre>

  <li> static memory manager:
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>

</ul>
  
<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_02.cc&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods: 
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_01.cc&method=debug">boolean debug(const unichar* message) const;</a></pre>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=setDebug">boolean setDebug(Integral::DEBUG level);</a></pre>       
       
  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=destructor">~StatisticalModelAdaptation();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=default+constructor">StatisticalModelAdaptation(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=copy+constructor">StatisticalModelAdaptation(const StatisticalModelAdaptation& arg);</a></pre>

  <li> assign methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&method=assign&instance=0">boolean assign(const StatisticalModelAdaptation& arg);</a></pre>
       
  <li> operator= methods:
       
      <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=operator%3D&instance=0">StatisticalModelAdaptation& operator= (const StatisticalModelAdaptation& arg);</a></pre>
              
  <li> i/o methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_04.cc&method=sofSize">long sofSize() const;</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_03.cc&method=read">boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_04.cc&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_03.cc&method=readData">boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_04.cc&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>     

  <li> equality methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&method=eq&instance=0">boolean eq(const StatisticalModelAdaptation& arg) const;</a></pre>
       
  <li> memory management methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=new\[\]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=delete\[\]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=setGrowSize">static boolean setGrowSize(long grow_size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_00.cc&method=clear">boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);</a></pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> set methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=setAlgorithm">boolean setAlgorithm(ALGORITHM algorithm);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=setImplementation">boolean setImplementation(IMPLEMENTATION implementation);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=set">boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);</a></pre>

  <li> get methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=getAlgorithm">ALGORITHM getAlgorithm() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=getImplementation">IMPLEMENTATION getImplementation() const;</a></pre>       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/StatisticalModelAdaptation.h&method=get">boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation);</a></pre>

  <li> method to adapt the model:
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_05.cc&method=adapt">boolean adapt(RegressionDecisionTree& rdt_a, Vector<StatisticalModel>& stat_models_a);</a></pre>       
       
  <li> other methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_03.cc&method=setParser">boolean setParser(SofParser* parser);</a></pre>
</ul>

<a name="private">
<b>private methods:</b>
<br><br>

<ul>       
  <li> find a terminal by given a regression decision tree and node index

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/StatisticalModelAdaptation/smadp_05.cc&method=findTerminal">BiGraphVertex<RegressionDecisionTreeNode>* findTerminal(RTreeNode*& root_node_a, long index_a);</a></pre>

</ul>

<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> none
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> none
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
