|
kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
|
Incremental accumulator for speaker-level / streaming cmvn. More...
#include <feature-cmvn.h>
Public Member Functions | |
| CmvnAccumulator (int32_t dim=0) | |
| Construct an accumulator for features of dimension dim. | |
| void | Accumulate (const MatrixF &feats) |
| Accumulate stats for a feature matrix (rows = frames); equivalent to calling Add() for each row with weight 1.0. | |
| void | Add (int32_t dim, const float *frame, float weight=1.0f) |
| Accumulate stats for one frame of dimension dim, applying the same updates as the free function AccCmvnStats(). | |
| const MatrixD & | Stats () const |
| Return the accumulated 2-row stats: row 0 = [sums, count], row 1 = [sumsq, (unused)]; see InitCmvnStats() for the layout. | |
Incremental accumulator for speaker-level / streaming cmvn.
It always keeps the full 2-row layout (see InitCmvnStats()) and adds up weighted frames one by one, so stats can be collected over many utterances of the same speaker and normalized later with ApplyCmvn().
|
explicit |
Construct an accumulator for features of dimension dim.
| dim | Feature dimension; 0 (the default) creates an empty accumulator whose stats are grown by the first Add(). |
| void knf::CmvnAccumulator::Accumulate | ( | const MatrixF & | feats | ) |
Accumulate stats for a feature matrix (rows = frames); equivalent to calling Add() for each row with weight 1.0.
| void knf::CmvnAccumulator::Add | ( | int32_t | dim, |
| const float * | frame, | ||
| float | weight = 1.0f ) |
Accumulate stats for one frame of dimension dim, applying the same updates as the free function AccCmvnStats().
| dim | Feature dimension; must match the dimension given to the constructor. |
| frame | Pointer to one frame, a 1-D array of size dim. |
| weight | Weight of this frame, e.g. 1.0. |
|
inline |
Return the accumulated 2-row stats: row 0 = [sums, count], row 1 = [sumsq, (unused)]; see InitCmvnStats() for the layout.