#include <sent/stddefs.h>
#include <sent/hmm_calc.h>
Go to the source code of this file.
Defines | |
#define | PLUGIN_TITLE "Gaussian calculation plugin for Julius" |
Gaussian mixture calculation plugin:. | |
#define | GPRUNE_OPT "mycalc" |
Functions | |
int | initialize () |
Initialization at loading time (optional). | |
int | get_plugin_info (int opcode, char *buf, int buflen) |
Get information of this plugin (required). | |
void | calcmix_get_optname (char *buf, int buflen) |
Return option string to select at option. | |
void | calcmix (HMMWork *wrk, HTK_HMM_Dens **g, int num, int *last_id, int lnum) |
A basic implementaion of computing Gaussians. | |
void | calcmix_free (HMMWork *wrk) |
Free work area. | |
boolean | calcmix_init (HMMWork *wrk) |
Initialize and setup work area for Gaussian computation. |
This sample uses Julius libraries.
Definition in file calcmix.c.
#define PLUGIN_TITLE "Gaussian calculation plugin for Julius" |
Gaussian mixture calculation plugin:.
Required:
int initialize | ( | ) |
int get_plugin_info | ( | int | opcode, | |
char * | buf, | |||
int | buflen | |||
) |
Get information of this plugin (required).
This function should return informations of this plugin file. The required info will be specified by opcode:
This will be called just after Julius find this file and after initialize().
opcode | [in] requested operation code | |
buf | [out] buffer to store the return string | |
buflen | [in] maximum length of buf |
void calcmix_get_optname | ( | char * | buf, | |
int | buflen | |||
) |
Return option string to select at option.
(required)
This function should return option string which should be specified as an argument "-gprune" option, to be used on Julius. The returning string should not be the same with any existing value.
This function will be called several times at option parsing at startup.
buf | [out] buffer to store the return string | |
buflen | [in] maximum length of buf |
void calcmix | ( | HMMWork * | wrk, | |
HTK_HMM_Dens ** | g, | |||
int | num, | |||
int * | last_id, | |||
int | lnum | |||
) |
A basic implementaion of computing Gaussians.
This function should compute output probabilities for each Gaussians. after this function returns, Julius will do addlog to get the final output log probability.
The input vector to be computed is located at wrk->OP_vec[], at a length of wrk->OP_veclen. Gaussians are given by g[], at a number of num. last_id and lnum is for internal use for pruning, just ignore them.
The scores for each Gaussians computed in this function should be stored in OP_calced_score[], with their corresponding Gaussian ids to OP_calced_id. The total number of calculated mixtures shuold also stored in OP_calced_num.
wrk | [i/o] HMM computation work area to store data | |
g | [in] set of Gaussian densities to compute the output probability. | |
num | [in] length of above | |
last_id | [in] ID list of N-best mixture in previous input frame, or NULL if not exist | |
lnum | [in] length of last_id |
void calcmix_free | ( | HMMWork * | wrk | ) |
Initialize and setup work area for Gaussian computation.
You should set value for OP_calced_maxnum, and allocate OP_calced_score and OP_calced_id. Remaining the content below is safe.
This will be called once on instance initialization at startup.
wrk | [i/o] HMM computation work area |