PocketSphinx  5prealpha
ms_senone.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1999-2004 Carnegie Mellon University. All rights
4  * reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * This work was supported in part by funding from the Defense Advanced
19  * Research Projects Agency and the National Science Foundation of the
20  * United States of America, and the CMU Sphinx Speech Consortium.
21  *
22  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
26  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * ====================================================================
35  *
36  */
37 /*
38  * senone.h -- Mixture density weights associated with each tied state.
39  */
40 
41 #ifndef _MS_SENONE_H_
42 #define _MS_SENONE_H_
43 
44 
45 /* SphinxBase headers. */
46 #include <sphinxbase/err.h>
47 #include <sphinxbase/ckd_alloc.h>
48 #include <sphinxbase/cmd_ln.h>
49 #include <sphinxbase/logmath.h>
50 
51 /* Local headers. */
52 #include "ms_gauden.h"
53 #include "bin_mdef.h"
54 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 typedef uint8 senprob_t;
76 typedef struct {
77  senprob_t ***pdf;
84  logmath_t *lmath;
85  uint32 n_sen;
86  uint32 n_feat;
87  uint32 n_cw;
88  uint32 n_gauden;
89  float32 mixwfloor;
90  uint32 *mgau;
91  int32 *featscr;
92  int32 aw;
93 } senone_t;
94 
95 
103  char const *mixwfile,
104  char const *mgau_mapfile,
107  float32 mixwfloor,
108  logmath_t *lmath,
109  bin_mdef_t *mdef
110  );
111 
113 void senone_free(senone_t *s);
119 int32 senone_eval (senone_t *s, int id,
120  gauden_dist_t **dist,
124  int n_top
125  );
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif
senprob_t *** pdf
gaussian density mixture weights, organized two possible ways depending on n_gauden: if (n_gauden &gt; 1...
Definition: ms_senone.h:77
int32 aw
Inverse acoustic weight.
Definition: ms_senone.h:92
Structure to store distance (density) values for a given input observation wrt density values in some...
Definition: ms_gauden.h:71
Binary format model definition files, with support for heterogeneous topologies and variable-size N-p...
float32 mixwfloor
floor applied to each PDF entry
Definition: ms_senone.h:89
uint32 n_sen
Number senones in this set.
Definition: ms_senone.h:85
uint32 * mgau
senone-id -&gt; mgau-id mapping for senones in this set
Definition: ms_senone.h:90
8-bit senone PDF structure.
Definition: ms_senone.h:76
uint32 n_feat
Number feature streams.
Definition: ms_senone.h:86
int32 * featscr
The feature score for every senone, will be initialized inside senone_eval_all.
Definition: ms_senone.h:91
int32 senone_eval(senone_t *s, int id, gauden_dist_t **dist, int n_top)
Evaluate the score for the given senone wrt to the given top N gaussian codewords.
(Sphinx 3.0 specific) Gaussian density module.
void senone_free(senone_t *s)
Release memory allocated by senone_init.
Definition: ms_senone.c:341
logmath_t * lmath
log math computation
Definition: ms_senone.h:84
uint32 n_cw
Number codewords per codebook,stream.
Definition: ms_senone.h:87
uint32 n_gauden
Number gaussian density codebooks referred to by senones.
Definition: ms_senone.h:88
Multivariate gaussian mixture density parameters.
Definition: ms_gauden.h:82
senone_t * senone_init(gauden_t *g, char const *mixwfile, char const *mgau_mapfile, float32 mixwfloor, logmath_t *lmath, bin_mdef_t *mdef)
Load a set of senones (mixing weights and mixture gaussian codebook mappings) from the given files...
Definition: ms_senone.c:275
uint8 senprob_t
Senone logs3-probs, truncated to 8 bits.
Definition: ms_senone.h:67