plugin/calcmix.c File Reference

A sample plugin for calculating Gaussians. More...

#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.


Detailed Description

A sample plugin for calculating Gaussians.

This sample uses Julius libraries.

Author:
Akinobu Lee
Date:
Mon Aug 11 15:29:45 2008
Revision
1.1

Definition in file calcmix.c.


Define Documentation

#define PLUGIN_TITLE   "Gaussian calculation plugin for Julius"

Gaussian mixture calculation plugin:.

Required:

Definition at line 49 of file calcmix.c.


Function Documentation

int initialize (  ) 

Initialization at loading time (optional).

If defined, this will be called just before this plugin is loaded to Julius. if this returns -1, the whole functions in this file will not be loaded.

This function is OPTIONAL.

Returns:
0 on success, -1 on failure.

Definition at line 75 of file calcmix.c.

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().

Parameters:
opcode [in] requested operation code
buf [out] buffer to store the return string
buflen [in] maximum length of buf
Returns:
0 on success, -1 on failure. On failure, Julius will ignore this plugin.

Definition at line 117 of file calcmix.c.

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.

Parameters:
buf [out] buffer to store the return string
buflen [in] maximum length of buf

Definition at line 162 of file calcmix.c.

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.

Parameters:
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

Definition at line 227 of file calcmix.c.

void calcmix_free ( HMMWork wrk  ) 

Free work area.

You should free all allocated at clacmix_init().

Parameters:
wrk [i/o] HMM computation work area

Definition at line 281 of file calcmix.c.

boolean calcmix_init ( 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.

Parameters:
wrk [i/o] HMM computation work area
Returns:
TRUE on success, FALSE on failure.

Definition at line 314 of file calcmix.c.


Generated on Thu Jul 23 12:14:20 2009 for Julius by  doxygen 1.5.1