?? gauss_example_32f_select.txt
字號:
to delta calculation
number of calculated probabilities is returned
or -1 for wrong arguments
int State_Number(void) - get state number in calculator (state_number)
int Max_Gauss(void) - get maximal Gaussians in mixture (max_gauss)
int Feature_Length(void) - get feature vector length in calculator
float *Mean(int state) - get pointer to first element of first mean of state
float *Var(int state) - get pointer to first element of first var of state
float *Det(int state) - get pointer to first det of state
float *Weight(int state) - get pointer to first weight of state
void Get_Statistics(Len_Stat *stat) - get statistics of whole number of gaussian component
and number of calculated components. It's necessary
for case with LogGauss Selection. In other cases it
returns 0.
int Init_Select_Gauss(char *file, int cdbksize, int num_clust, float val,
int num_vec, bool is_row) - internal structures initialization for Gaussian Selection
algorithm. Does nothing if the calculation hint is not equal
to calcVecS. This function initializes Select_Gauss object
that contains codebook and global shortlist and is used for
local shortlist calculation. If codebook with required
number of cluster is not in parameter file it is built
from Gaussian means and grand variance and is written to
HMM parameter file. Other arguments determine Gaussain
Selection algorithm features.
Feat_Calc class
Calculates feature vectors for probability calculator. Fake producer provides zero
feature vectors. File producer takes data from HTK feature file with float data.
Two modes of feature processing are supported: raw features without energy (as for
the first decoder pass) and CMS&VN'ed features with energy (as for the second pass).
Delta or double delta are calculated if necessary.
Feat_Calc (int space_dim, int max_delay) - constructor
Each feature vector of length space_dim is
appended to the length (space_dim+3)&(~3)
for 16 byte alignment
max_delay is used to imitate low delay
feature producer - features are calculated by
portions of length no more than max_delay.
If deltas are calculated delta_delay =
delta_window*(delta_number+1) is added.
delta_delay is 0 for fake feature producer
If max_delay<=0 features for all utterance
could be calculated at once
Feature producer has no internal buffer and
calculates features in consumer's buffer
~Init_Feat(void) - destructor
int Init_Feat(int frame_number) - internal structures initialization for fake
int Init_Feat(char *file) and SDT based feature producers
Fake feature producer provides an utterance
of frame_number frames, each frame is zero
vector of length space_dim
HTK file based feature producer reads raw feature
vectors of length raw_dim from HTK feature file
Feature vector elements assumed to be floats.
space_dim should be equal to raw_dim, raw_dim*2,
raw_dim*3, (raw_dim-1), (raw_dim-1)*2 or
(raw_dim-1)*3. If necessary last element of
raw feature is deleted and deltas or double
deltas with delta_window=2 are calculated.
>= 0 if OK, otherwise failed
After successful constructor and Init_Feat calls producer is ready
bool Ready(void) - true if producer is ready, false otherwise
int Get_Feature(float *dst, int len, bool* end)
- puts calculated featurs to consumers buffer dst
len features is requested, the number of
fully calculated features is returned
if utterance is not ended they are followed by
delta_delay partially calculated feature vectors
The first partially calculated feature vector is
passed as dst for the next feature portion
if the calculated portion ends the utterance
end[0] is true otherwise false
int Feature_Length(void) - get output feature vector length
int Delta_Delay(void) - get delta_delay of feature producer
Probability calculator requests this number to
provide correct interaction with probability
int Write_LogHeader(FILE *flog) - writes HTK feature file header to log file
feature vector length includes deltas or
double deltas if any
calculator
Select_Gauss class
Contains codebook and shortlist that are used for LogGauss Selection. Also contain
function to manage indexes (for input vectors) and Sign table (it's necessary for
function ippsLogGaussMixture_Select_32f_D2 in probability calculation)
Select_Gauss (int cdbk_size, bool is_row, int n_vec, float val, int num_clust, int spc_dim)
- constructor, simply fill zero in pointers
and set values to zero
cdbk_size - number of clusters in codebook,
is_row - defines method of global shortlist filling
if true - shortlist is filled by rows (one or more
components of each mixture are chosen to be active
for each codebook cluster)
if false - shortlist is filled by columns (each
component of each mixture are chosen to be active
for one or more codebook clusters)
n_vec - number of active components if is_row is true or
number of clusters for which component is active
if is_row is false
if num_vec is 0, variable number of components are
activated according to threshold value val.
used while shortlist building
val - defines component activating threshold
if is_row is true then for each cluster
components with distance to centroid less then
minimal*val are activated
if is_row is false then each component is activated
for clusters with distance to centroid less then
minimal*val
used while shortlist building
num_clust - mixture components belonging to num_clust clusters
closest to input feature vector are calculated
used while mixture calculating
spc_dim - feature space dimension
~Select_Gauss(void) - destructor
int Init_SelectGauss_Simple(int m_len, int m_gauss, int gss_num, foat *tmpcodebook, float *weights,
float *meanSet, Mixture *states, int states_num)
- initializes internal structure such as codebook using
input arrays, which have been read from param files by
function ReadAndInitCdbk.
m_len - maximum length of input vectors to quantize
m_gauss - maximum number of gaussian mixture components
gss_num - number of gaussians in the model
tmpcodebook - array to store created codebook
weights - array of weights for weighted Euclidean distance
meanSet - array of means values, it's source for creating codebook
states - array of components for each state
states_num - number of states
int Init_SelectGauss_Full(int m_len, int m_gauss, int gss_num, foat *tmpcodebook, float *weights,
float *meanSet, Mixture *states, int states_num)
- initializes internal structure and create codebook using
input arrays, which have been read from param files by
function CreateInitSaveCdbk. Also return created codebook
vectors and weights vector to parent function to save it
into the param file.
m_len - maximum length of input vectors to quantize
m_gauss - maximum number of gaussian mixture components
gss_num - number of gaussians in the model
tmpcodebook - array to store created codebook
weights - array to store weights for weighted Euclidean distance
meanSet - array of means values, it's source for creating codebook
states - array of components for each state
states_num - number of states
int CreateShortList(float* means) - fills shortlist using means array and created by previous
functions codebook
int CommonInit(float* means) - mallocs arrays for select_gauss object and call previous
function to fill shortlist
int WriteVQ(float* feature, int shift, int len)
- quantize input vector according to the shortlist and input
parameters
feature - input vector
shift - shift in the indexes vector
len - len of input vectors to quantize
int ShiftIndxBegin(int len) - shifts indexes in the index vector. It's necessary to
accord the StepForward function when we shift and reread
input vector
int FillSign(int esnmix, int shiftbits, int num,int shift)
- fills Sign table using vector of indexes, shortlist and
it's own parameters.
esnmix - number of mixture components
shiftbits - shift in shortlist table in bits
num - number of indexes to fill
shift - shift in vector of indexes
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -