mlpg
Functions
-
int main(int argc, char *argv[])
mlpg [ option ] [ infile ]
-l int
length of vector \((1 \le M + 1)\)
-m int
order of vector \((0 \le M)\)
-s int
number of past frames \((0 \le S)\)
-q int
input format
0
\(\boldsymbol{\mu}\), \(\boldsymbol{\varSigma}\)1
\(\boldsymbol{\mu}\), \(\boldsymbol{\varSigma}^{-1}\)2
\(\boldsymbol{\mu\varSigma}^{-1}\), \(\boldsymbol{\varSigma}^{-1}\)
-d double+
delta coefficients
-D string
filename of double-type delta coefficients
-r int+
width of 1st (and 2nd) regression coefficients
-magic double
magic number
-R int
mode
0
recursive (Kalman filter)1
non-recursive (Cholesky decomposition)
infile str
double-type mean and variance parameter sequence
stdout
double-type static parameter sequence
See also
-
class sptk::RecursiveMaximumLikelihoodParameterGeneration
Estimate the maximum likelihood parameters from the means and the diagonal covariances of Gaussian distributions.
The input is the sequence of the mean and the diagnoal covariance of \(M\)-th order static and \(DM\)-th order dynamic feature components:
\[ \begin{array}{ccccc} \boldsymbol{\mu}_1, & \boldsymbol{\varSigma}_1, & \ldots, & \boldsymbol{\mu}_T, & \boldsymbol{\varSigma}_T, \end{array} \]where\[\begin{split}\begin{eqnarray} \boldsymbol{\mu}_t &=& \left[ \begin{array}{cccc} \boldsymbol{\mu}_t^{(0)}, & \boldsymbol{\mu}_t^{(1)}, & \ldots, & \boldsymbol{\mu}_t^{(D)} \end{array} \right] \\ \boldsymbol{\varSigma}_t &=& \left[ \begin{array}{cccc} \boldsymbol{\varSigma}_t^{(0)}, & \boldsymbol{\varSigma}_t^{(1)}, & \ldots, & \boldsymbol{\varSigma}_t^{(D)} \end{array} \right]. \end{eqnarray}\end{split}\]The output is the sequence of the \(M\)-th order smoothed static feature components:\[ \begin{array}{cccc} \boldsymbol{c}_1, & \boldsymbol{c}_2, & \ldots, & \boldsymbol{c}_T. \end{array} \]The impelemented algorithm is based on a recursive manner using Kalman filter. The algorithm does not require entire mean and varaiance parameter sequence, but intorduces approximation error. The amount of approximation error is controlled by a parameter, \(S\).
Public Functions
-
RecursiveMaximumLikelihoodParameterGeneration(int num_order, int num_past_frame, const std::vector<std::vector<double>> &window_coefficients, InputSourceInterface *input_source)
- Parameters
num_order – [in] Order of coefficients, \(M\).
num_past_frame – [in] Number of past frames, \(S\).
window_coefficients – [in] Window coefficients. e.g.) { {-0.5, 0.0, 0.5}, {1.0, -2.0, 1.0} }
input_source – [in] Static and dynamic components sequence.
-
inline int GetNumOrder() const
- Returns
Order of coefficients.
-
inline int GetNumPastFrame() const
- Returns
Number of past frames.
-
inline bool IsValid() const
- Returns
True if this object is valid.
-
bool Get(std::vector<double> *smoothed_static_parameters)
- Parameters
smoothed_static_parameters – [out] Smoothed static parameters.
- Returns
True on success, false on failure.
-
RecursiveMaximumLikelihoodParameterGeneration(int num_order, int num_past_frame, const std::vector<std::vector<double>> &window_coefficients, InputSourceInterface *input_source)
-
class sptk::NonrecursiveMaximumLikelihoodParameterGeneration
Estimate the maximum likelihood parameters from the means and the diagonal covariances of Gaussian distributions.
The input is the sequence of the mean and the diagnoal covariance of \(M\)-th order static and \(DM\)-th order dynamic feature components:
\[ \begin{array}{ccccc} \boldsymbol{\mu}_1, & \boldsymbol{\varSigma}_1, & \ldots, & \boldsymbol{\mu}_T, & \boldsymbol{\varSigma}_T, \end{array} \]where\[\begin{split}\begin{eqnarray} \boldsymbol{\mu}_t &=& \left[ \begin{array}{cccc} \boldsymbol{\mu}_t^{(0)}, & \boldsymbol{\mu}_t^{(1)}, & \ldots, & \boldsymbol{\mu}_t^{(D)} \end{array} \right] \\ \boldsymbol{\varSigma}_t &=& \left[ \begin{array}{cccc} \boldsymbol{\varSigma}_t^{(0)}, & \boldsymbol{\varSigma}_t^{(1)}, & \ldots, & \boldsymbol{\varSigma}_t^{(D)} \end{array} \right]. \end{eqnarray}\end{split}\]The output is the sequence of the \(M\)-th order smoothed static feature components:\[ \begin{array}{cccc} \boldsymbol{c}_1, & \boldsymbol{c}_2, & \ldots, & \boldsymbol{c}_T. \end{array} \]Public Functions
-
NonrecursiveMaximumLikelihoodParameterGeneration(int num_order, const std::vector<std::vector<double>> &window_coefficients, bool use_magic_number, double magic_number = 0.0)
- Parameters
num_order – [in] Order of coefficients, \(M\).
window_coefficients – [in] Window coefficients. e.g.) { {-0.5, 0.0, 0.5}, {1.0, -2.0, 1.0} }
use_magic_number – [in] Whether to use magic number.
magic_number – [in] A magic number represents a discrete symbol.
-
inline int GetNumOrder() const
- Returns
Order of coefficients.
-
inline double GetMagicNumber() const
- Returns
Magic number.
-
inline bool IsValid() const
- Returns
True if this object is valid.
-
bool Run(const std::vector<std::vector<double>> &mean_vectors, const std::vector<std::vector<double>> &variance_vectors, std::vector<std::vector<double>> *smoothed_static_parameters) const
- Parameters
mean_vectors – [in] Mean vector sequence. The shape is \([T, DM]$\).
variance_vectors – [in] Variance vector sequence. The shape is \([T, DM]$\).
smoothed_static_parameters – [out] Smoothed static parameters.
- Returns
True on success, false on failure.
-
bool Run(const std::vector<std::vector<double>> &mean_vectors, const std::vector<SymmetricMatrix> &covariance_matrices, std::vector<std::vector<double>> *smoothed_static_parameters) const
- Parameters
mean_vectors – [in] Mean vector sequence. The shape is \([T, DM]$\).
covariance_matrices – [in] Covariance matrix sequence. The shape is \([T, DM, DM]$\).
smoothed_static_parameters – [out] Smoothed static parameters.
- Returns
True on success, false on failure.
-
NonrecursiveMaximumLikelihoodParameterGeneration(int num_order, const std::vector<std::vector<double>> &window_coefficients, bool use_magic_number, double magic_number = 0.0)