Commit b5b90db7 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

Bug fix in StatServer accumulate_stat

parent 4ec2f819
......@@ -41,7 +41,7 @@ class IdMap:
"""A class that stores a map between identifiers (strings). One
list is called 'leftids' and the other 'rightids'. The class
provides methods that convert a sequence of left ids to a
sequence of right ids and vice versa. If 'leftids' or 'rightids'
sequence of right ids and vice versa. If `leftids` or `rightids`
contains duplicates then all occurrences are used as the index
when mapping.
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>features_server &mdash; SIDEKIT 1.1.0 documentation</title>
<title>features_server &mdash; SIDEKIT 1.1.6 documentation</title>
<link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
......@@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.1.0',
VERSION: '1.1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -23,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="SIDEKIT 1.1.0 documentation" href="../index.html" />
<link rel="top" title="SIDEKIT 1.1.6 documentation" href="../index.html" />
<link rel="up" title="Module code" href="index.html" />
</head>
<body role="document">
......@@ -36,7 +36,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
......@@ -661,7 +661,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Module code</a> &raquo;</li>
</ul>
</div>
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frontend.features &mdash; SIDEKIT 1.1.0 documentation</title>
<title>frontend.features &mdash; SIDEKIT 1.1.6 documentation</title>
<link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
......@@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '1.1.0',
VERSION: '1.1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -23,7 +23,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="SIDEKIT 1.1.0 documentation" href="../../index.html" />
<link rel="top" title="SIDEKIT 1.1.6 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body role="document">
......@@ -36,7 +36,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
......@@ -510,7 +510,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frontend.io &mdash; SIDEKIT 1.1.0 documentation</title>
<title>frontend.io &mdash; SIDEKIT 1.1.6 documentation</title>
<link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
......@@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '1.1.0',
VERSION: '1.1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -23,7 +23,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="SIDEKIT 1.1.0 documentation" href="../../index.html" />
<link rel="top" title="SIDEKIT 1.1.6 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body role="document">
......@@ -36,7 +36,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
......@@ -1099,7 +1099,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frontend.normfeat &mdash; SIDEKIT 1.1.0 documentation</title>
<title>frontend.normfeat &mdash; SIDEKIT 1.1.6 documentation</title>
<link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
......@@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '1.1.0',
VERSION: '1.1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -23,7 +23,7 @@
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<link rel="top" title="SIDEKIT 1.1.0 documentation" href="../../index.html" />
<link rel="top" title="SIDEKIT 1.1.6 documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body role="document">
......@@ -36,7 +36,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
......@@ -308,7 +308,7 @@
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &raquo;</li>
</ul>
</div>
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sidekit_io &mdash; SIDEKIT 1.1.0 documentation</title>
<title>sidekit_io &mdash; SIDEKIT 1.1.6 documentation</title>
<link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
......@@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.1.0',
VERSION: '1.1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -23,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="SIDEKIT 1.1.0 documentation" href="../index.html" />
<link rel="top" title="SIDEKIT 1.1.6 documentation" href="../index.html" />
<link rel="up" title="Module code" href="index.html" />
</head>
<body role="document">
......@@ -36,7 +36,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
......@@ -518,7 +518,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Module code</a> &raquo;</li>
</ul>
</div>
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>statserver &mdash; SIDEKIT 1.1.0 documentation</title>
<title>statserver &mdash; SIDEKIT 1.1.6 documentation</title>
<link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
......@@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.1.0',
VERSION: '1.1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
......@@ -23,7 +23,7 @@
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="SIDEKIT 1.1.0 documentation" href="../index.html" />
<link rel="top" title="SIDEKIT 1.1.6 documentation" href="../index.html" />
<link rel="up" title="Module code" href="index.html" />
</head>
<body role="document">
......@@ -36,7 +36,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Module code</a> &raquo;</li>
</ul>
</div>
......@@ -202,43 +202,6 @@
<span class="n">e_hh</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">=</span> <span class="n">inv_lambda</span> <span class="o">+</span> <span class="n">numpy</span><span class="o">.</span><span class="n">outer</span><span class="p">(</span><span class="n">e_h</span><span class="p">[</span><span class="n">idx</span><span class="p">],</span> <span class="n">e_h</span><span class="p">[</span><span class="n">idx</span><span class="p">],</span> <span class="n">tmp</span><span class="p">)</span>
<span class="nd">@process_parallel_lists</span>
<span class="k">def</span> <span class="nf">fa_model_loop_uncertainty</span><span class="p">(</span><span class="n">batch_start</span><span class="p">,</span>
<span class="n">mini_batch_indices</span><span class="p">,</span>
<span class="n">r</span><span class="p">,</span>
<span class="n">phi_white</span><span class="p">,</span>
<span class="n">phi</span><span class="p">,</span>
<span class="n">stat0</span><span class="p">,</span>
<span class="n">stat1</span><span class="p">,</span>
<span class="n">e_h</span><span class="p">,</span>
<span class="n">e_hh</span><span class="p">,</span>
<span class="n">y_un</span><span class="p">,</span>
<span class="n">num_thread</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :param batch_start: index to start at in the list</span>
<span class="sd"> :param mini_batch_indices: indices of the elements in the list (should start at zero)</span>
<span class="sd"> :param r: rank of the matrix</span>
<span class="sd"> :param phi_white: whitened version of the factor matrix</span>
<span class="sd"> :param phi: non-whitened version of the factor matrix</span>
<span class="sd"> :param sigma: covariance matrix</span>
<span class="sd"> :param stat0: matrix of zero order statistics</span>
<span class="sd"> :param stat1: matrix of first order statistics</span>
<span class="sd"> :param e_h: accumulator</span>
<span class="sd"> :param e_hh: accumulator</span>
<span class="sd"> :param num_thread: number of parallel process to run</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="n">phi</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">phi</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">STAT_TYPE</span><span class="p">)</span>
<span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="n">mini_batch_indices</span><span class="p">:</span>
<span class="n">inv_lambda</span> <span class="o">=</span> <span class="n">scipy</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">inv</span><span class="p">(</span><span class="n">numpy</span><span class="o">.</span><span class="n">eye</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="n">phi_white</span><span class="o">.</span><span class="n">T</span> <span class="o">*</span> <span class="n">stat0</span><span class="p">[</span><span class="n">idx</span> <span class="o">+</span> <span class="n">batch_start</span><span class="p">,</span> <span class="p">:])</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">phi_white</span><span class="p">))</span>
<span class="n">y_un</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">diag</span><span class="p">(</span><span class="n">inv_lambda</span><span class="p">)</span>
<span class="n">Aux</span> <span class="o">=</span> <span class="n">phi_white</span><span class="o">.</span><span class="n">T</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">stat1</span><span class="p">[</span><span class="n">idx</span> <span class="o">+</span> <span class="n">batch_start</span><span class="p">,</span> <span class="p">:])</span>
<span class="n">numpy</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">Aux</span><span class="p">,</span> <span class="n">inv_lambda</span><span class="p">,</span> <span class="n">out</span><span class="o">=</span><span class="n">e_h</span><span class="p">[</span><span class="n">idx</span><span class="p">])</span>
<span class="n">e_hh</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">=</span> <span class="n">inv_lambda</span> <span class="o">+</span> <span class="n">numpy</span><span class="o">.</span><span class="n">outer</span><span class="p">(</span><span class="n">e_h</span><span class="p">[</span><span class="n">idx</span><span class="p">],</span> <span class="n">e_h</span><span class="p">[</span><span class="n">idx</span><span class="p">],</span> <span class="n">tmp</span><span class="p">)</span>
<span class="nd">@process_parallel_lists</span>
<span class="k">def</span> <span class="nf">fa_distribution_loop</span><span class="p">(</span><span class="n">distrib_indices</span><span class="p">,</span> <span class="n">_A</span><span class="p">,</span> <span class="n">stat0</span><span class="p">,</span> <span class="n">batch_start</span><span class="p">,</span> <span class="n">batch_stop</span><span class="p">,</span> <span class="n">e_hh</span><span class="p">,</span> <span class="n">num_thread</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
......@@ -430,6 +393,7 @@
<span class="sd">&quot;&quot;&quot;Read StatServer in hdf5 format</span>
<span class="sd"> </span>
<span class="sd"> :param statserver_file_name: name of the file to read from</span>
<span class="sd"> :param prefix: prefixe of the dataset to read from in HDF5 file</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">with</span> <span class="n">h5py</span><span class="o">.</span><span class="n">File</span><span class="p">(</span><span class="n">statserver_file_name</span><span class="p">,</span> <span class="s">&quot;r&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">statserver</span> <span class="o">=</span> <span class="n">StatServer</span><span class="p">()</span>
......@@ -743,13 +707,20 @@
</div>
<div class="viewcode-block" id="StatServer.whiten_stat1"><a class="viewcode-back" href="../statserver.html#statserver.StatServer.whiten_stat1">[docs]</a> <span class="k">def</span> <span class="nf">whiten_stat1</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mu</span><span class="p">,</span> <span class="n">sigma</span><span class="p">,</span> <span class="n">isSqrInvSigma</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Whiten first-order statistics</span>
<span class="sd"> If sigma.ndim == 1, case of a diagonal covariance</span>
<span class="sd"> If sigma.ndim == 2, case of a single Gaussian with full covariance</span>
<span class="sd"> If sigma.ndim == 3, case of a full covariance UBM</span>
<span class="sd"> </span>
<span class="sd"> :param mu: array, mean vector to be subtracted from the statistics</span>
<span class="sd"> :param sigma: narray, co-variance matrix or covariance super-vector</span>
<span class="sd"> :param isSqrInvSigma: boolean, True if the input Sigma matrix is the inverse of the square root of a covariance</span>
<span class="sd"> matrix</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">sigma</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="k">if</span> <span class="n">sigma</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">center_stat1</span><span class="p">(</span><span class="n">mu</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">stat1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stat1</span> <span class="o">/</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">sigma</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">sigma</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="c"># Compute the inverse square root of the co-variance matrix Sigma</span>
<span class="n">sqr_inv_sigma</span> <span class="o">=</span> <span class="n">sigma</span>
......@@ -767,9 +738,16 @@
<span class="c"># Whitening of the first-order statistics</span>
<span class="bp">self</span><span class="o">.</span><span class="n">center_stat1</span><span class="p">(</span><span class="n">mu</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">rotate_stat1</span><span class="p">(</span><span class="n">sqr_inv_sigma</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">sigma</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">elif</span> <span class="n">sigma</span><span class="o">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
<span class="c"># we assume that sigma is a 3D ndarray of size D x n x n</span>
<span class="c"># where D is the number of distributions and n is the dimension of a single distibution</span>
<span class="n">n</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stat1</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">//</span> <span class="bp">self</span><span class="o">.</span><span class="n">stat0</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="n">sess_nb</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stat0</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">center_stat1</span><span class="p">(</span><span class="n">mu</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">stat1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stat1</span> <span class="o">/</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">sigma</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">stat1</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">einsum</span><span class="p">(</span><span class="s">&quot;ikj,ikl-&gt;ilj&quot;</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">stat1</span><span class="o">.</span><span class="n">T</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">sess_nb</span><span class="p">),</span> <span class="n">sigma</span><span class="p">)</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">sess_nb</span><span class="p">)</span><span class="o">.</span><span class="n">T</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s">&#39;Wrong dimension of Sigma, must be 1 or 2&#39;</span><span class="p">)</span>
</div>
......@@ -1984,7 +1962,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.0 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">SIDEKIT 1.1.6 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Module code</a> &raquo;</li>
</ul>
</div>
......
......@@ -5,6 +5,7 @@ This part of the documentation details the different tools for acoustic paramete
In **SIDEKIT**, low level interface for acoustic parametrization is implemented in the ``frontend``
module.
Two high level classes allow a fast and simple extraction of acoustic parameters:
- ``FeaturesExtractor``
- ``FeaturesServer``
......@@ -17,4 +18,3 @@ acoustic features. The HDF5 format is the prefered serialization format in **SID
hdf5
featuresextractor
featuresserver
lowlevel_param
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment