ms_senone.h
Go to the documentation of this file.
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* ====================================================================
* Copyright (c) 1999-2004 Carnegie Mellon University. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* This work was supported in part by funding from the Defense Advanced
* Research Projects Agency and the National Science Foundation of the
* United States of America, and the CMU Sphinx Speech Consortium.
*
* THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
* NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ====================================================================
*
*/
/*
* senone.h -- Mixture density weights associated with each tied state.
*/
#ifndef _MS_SENONE_H_
#define _MS_SENONE_H_
/* SphinxBase headers. */
#include <sphinxbase/err.h>
#include <sphinxbase/ckd_alloc.h>
#include <sphinxbase/cmd_ln.h>
#include <sphinxbase/logmath.h>
/* Local headers. */
#include "ms_gauden.h"
#include "bin_mdef.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8 senprob_t;
typedef struct {
senprob_t ***pdf;
logmath_t *lmath;
uint32 n_sen;
uint32 n_feat;
uint32 n_cw;
uint32 n_gauden;
float32 mixwfloor;
uint32 *mgau;
int32 *featscr;
int32 aw;
} senone_t;
senone_t *senone_init (gauden_t *g,
char const *mixwfile,
char const *mgau_mapfile,
float32 mixwfloor,
logmath_t *lmath,
bin_mdef_t *mdef
);
void senone_free(senone_t *s);
int32 senone_eval (senone_t *s, int id,
gauden_dist_t **dist,
int n_top
);
#ifdef __cplusplus
}
#endif
#endif
bin_mdef.h
Binary format model definition files, with support for heterogeneous topologies and variable-size N-p...
ms_gauden.h
(Sphinx 3.0 specific) Gaussian density module.
senone_eval
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.
senone_init
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
senone_free
void senone_free(senone_t *s)
Release memory allocated by senone_init.
Definition: ms_senone.c:341
senprob_t
uint8 senprob_t
Senone logs3-probs, truncated to 8 bits.
Definition: ms_senone.h:67
bin_mdef_s
Definition: bin_mdef.h:117
gauden_dist_t
Structure to store distance (density) values for a given input observation wrt density values in some...
Definition: ms_gauden.h:71
gauden_t
Multivariate gaussian mixture density parameters.
Definition: ms_gauden.h:82
senone_t
8-bit senone PDF structure.
Definition: ms_senone.h:76
senone_t::n_cw
uint32 n_cw
Number codewords per codebook,stream.
Definition: ms_senone.h:87
senone_t::featscr
int32 * featscr
The feature score for every senone, will be initialized inside senone_eval_all.
Definition: ms_senone.h:91
senone_t::mgau
uint32 * mgau
senone-id -> mgau-id mapping for senones in this set
Definition: ms_senone.h:90
senone_t::n_feat
uint32 n_feat
Number feature streams.
Definition: ms_senone.h:86
senone_t::n_gauden
uint32 n_gauden
Number gaussian density codebooks referred to by senones.
Definition: ms_senone.h:88
senone_t::n_sen
uint32 n_sen
Number senones in this set.
Definition: ms_senone.h:85
senone_t::pdf
senprob_t *** pdf
gaussian density mixture weights, organized two possible ways depending on n_gauden: if (n_gauden > 1...
Definition: ms_senone.h:77
senone_t::lmath
logmath_t * lmath
log math computation
Definition: ms_senone.h:84
senone_t::aw
int32 aw
Inverse acoustic weight.
Definition: ms_senone.h:92
senone_t::mixwfloor
float32 mixwfloor
floor applied to each PDF entry
Definition: ms_senone.h:89