adaptor.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  * adaptor.h -- Wrapper for structures of adaptation.
39  *
40  * **********************************************
41  * CMU ARPA Speech Project
42  *
43  * Copyright (c) 1999 Carnegie Mellon University.
44  * ALL RIGHTS RESERVED.
45  * **********************************************
46  *
47  * HISTORY
48  * $Log$
49  * Revision 1.1 2006/04/05 20:27:30 dhdfu
50  * A Great Reorganzation of header files and executables
51  *
52  * Revision 1.3 2006/02/22 14:48:13 arthchan2003
53  * Merged from SPHINX3_5_2_RCI_IRII_BRANCH: Added adapt_set_mllr (Moved from kb)
54  *
55  *
56  * Revision 1.1.4.3 2005/09/18 01:12:31 arthchan2003
57  * Add adapt_set_mllr which is responsible for single stream MLLR switching.
58  *
59  * Revision 1.1.4.2 2005/07/05 05:47:59 arthchan2003
60  * Fixed dox-doc. struct level of documentation are included.
61  *
62  * Revision 1.1.4.1 2005/06/27 05:22:19 arthchan2003
63  * Merged from the HEAD.
64  *
65  * Revision 1.2 2005/06/22 08:00:07 arthchan2003
66  * Completed all doxygen documentation on file description for libs3decoder/libutil/libs3audio and programs.
67  * Revision 1.2 2005/06/22 08:00:07 arthchan2003
68  * Completed all doxygen documentation on file description for libs3decoder/libutil/libs3audio and programs.
69  *
70  * Revision 1.1 2005/06/21 17:59:44 arthchan2003
71  * Log: Implementation and Interface of adapt_am_t, a wrapper of
72  * adaptation capabability of Sphinx 3. It takes the responsibility from
73  * kb_t to manage regA, regB and mllr_nclass. Interfaces are not fully
74  * completed. So "pointer" symtom code still appears in kb.c
75  *
76  * Revision 1.3 2005/06/19 19:41:21 archan
77  * Sphinx3 to s3.generic: Added multiple regression class for single stream MLLR. Enabled MLLR for livepretend and decode.
78  *
79  * Revision 1.2 2005/03/30 01:08:37 archan
80  * codebase-wide update. Performed an age-old trick: Adding $Log into all .c and .h files. This will make sure the commit message be preprended into a file.
81  *
82  *
83  * 25-Mar-2005 Arthur Chan (archan@cs.cmu.edu) at Carnegie Mellon Unversity
84  * First started.
85  */
86 
92 #ifndef _ADAPT_H_
93 #define _ADAPT_H_
94 
95 #include <s3types.h>
96 #include <cont_mgau.h>
97 #include <mdef.h>
98 #include <cmd_ln.h>
99 
100 #define ADAPTATION_MLLR 0
101 
102 #if 0 /* for forward compatibility */
103 #define ADAPTATION_MAP 1
104 #define ADAPTATION_PLSA 2
105 #endif
106 
107 #ifdef __cplusplus
108 extern "C" {
109 #endif
110 #if 0
111 } /* Fool Emacs into not indenting things. */
112 #endif
113 
119 typedef struct {
120  char* prevmllrfn;
121 #if 0
122  float32** regA;
123  float32* regB;
124 #endif
125 
126  float32*** regA;
127  float32** regB;
128  int32 mllr_nclass;
129 } adapt_am_t ;
130 
134 
137 void adapt_am_free(adapt_am_t *ad);
138 
140 void adapt_set_mllr(adapt_am_t *ad,
141  mgau_model_t *g,
142  const char *mllrfile,
143  const char* cbs2mllr,
144  mdef_t *mdef,
145  cmd_ln_t *config
146  );
147 #if 0
148 { /* Stop indent from complaining */
149 #endif
150 #ifdef __cplusplus
151 
152 
153 }
154 #endif
155 
156 #endif
strcture for storing the model definition.
Definition: mdef.h:184
A wrapper for all adaptation operations in Sphinx 3.X including MLLR and MAP.
Definition: adaptor.h:119
S3DECODER_EXPORT adapt_am_t * adapt_am_init(void)
float32 *** regA
Definition: adaptor.h:126
Interface of full GMM computation with integer value of log likelihood.
float32 ** regB
Definition: adaptor.h:127
int32 mllr_nclass
Definition: adaptor.h:128
Size definition of semantically units. Common for both s3 and s3.X decoder.
#define S3DECODER_EXPORT
Definition: sphinx3_export.h:15
The set of mixture-Gaussians in an acoustic model used in Sphinx 3.X family of tool.
Definition: cont_mgau.h:207
S3DECODER_EXPORT void adapt_set_mllr(adapt_am_t *ad, mgau_model_t *g, const char *mllrfile, const char *cbs2mllr, mdef_t *mdef, cmd_ln_t *config)
char * prevmllrfn
Definition: adaptor.h:120
Model definition.
S3DECODER_EXPORT void adapt_am_free(adapt_am_t *ad)