Edinburgh Speech Tools
2.4-release
Loading...
Searching...
No Matches
EST_dynamic_model.h
1
/*************************************************************************/
2
/* */
3
/* Centre for Speech Technology Research */
4
/* University of Edinburgh, UK */
5
/* Copyright (c) 1995,1996 */
6
/* All Rights Reserved. */
7
/* */
8
/* Permission is hereby granted, free of charge, to use and distribute */
9
/* this software and its documentation without restriction, including */
10
/* without limitation the rights to use, copy, modify, merge, publish, */
11
/* distribute, sublicense, and/or sell copies of this work, and to */
12
/* permit persons to whom this work is furnished to do so, subject to */
13
/* the following conditions: */
14
/* 1. The code must retain the above copyright notice, this list of */
15
/* conditions and the following disclaimer. */
16
/* 2. Any modifications must be clearly marked as such. */
17
/* 3. Original authors' names are not deleted. */
18
/* 4. The authors' names are not used to endorse or promote products */
19
/* derived from this software without specific prior written */
20
/* permission. */
21
/* */
22
/* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25
/* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
30
/* THIS SOFTWARE. */
31
/* */
32
/*************************************************************************/
33
/* Author : Simon King */
34
/* Date : June 1998 */
35
/*-----------------------------------------------------------------------*/
36
/* Dynamical models for ASR */
37
/* */
38
/*=======================================================================*/
39
40
#include <cstdlib>
41
#include <cstdio>
42
#include <fstream>
43
#include "EST.h"
44
#include "EST_model_types.h"
45
46
// for now, CSMM means continuous-state Markov model
47
class
CSMM
48
{
49
public
:
50
refcounted_EST_DMatrixP
F;
51
refcounted_EST_DMatrixP
H;
52
refcounted_EST_DVectorP
u_v;
53
refcounted_EST_DMatrixP
Q_v;
54
refcounted_EST_DVectorP
u_w;
55
refcounted_EST_DMatrixP
Q_w;
56
refcounted_EST_DVectorP
mean_initial_x;
57
stats_accumulator
stats;
58
};
59
60
bool
operator ==
(
const
CSMM
&,
const
CSMM
&);
61
ostream
&
operator <<
(
ostream
&s,
const
CSMM
&);
62
63
/// somewhere to keep the model parameters
64
struct
CSMM_parameter_set
65
{
66
EST_TKVL<EST_String,refcounted_EST_DMatrixP>
matrix_set;
67
EST_TKVL<EST_String,refcounted_EST_DVectorP>
vector_set;
68
};
69
70
/// somewhere to keep the models
71
struct
CSMM_set
72
{
73
EST_TKVL<EST_String,CSMM>
model_set;
74
CSMM_parameter_set
parameter_set;
75
};
76
77
78
79
ostream
&
operator <<
(
ostream
&s,
const
CSMM_set
&
ms
);
80
81
bool
82
create_empty_CSMM(
EST_String
model_name
,
83
CSMM_set
&model_set,
84
const
int
model_order
,
85
const
int
observation_order
);
86
87
/// at last, some interesting functions
88
bool
89
E_step(
CSMM
&
model
,
90
EST_DMatrix
&
mean_initial_covar_x
,
91
const
EST_TrackList
&
train_data
,
92
const
bool
trace);
93
bool
94
M_step(
CSMM
&
model
,
95
const
bool
trace);
96
bool
97
EM_shared_hidden_space(
CSMM_set
&
models
,
98
const
int
model_order
,
99
EST_DMatrix
&
mean_initial_covar_x
,
100
const
EST_TrackList
&
train_data
,
101
const
int
iterations
,
102
const
bool
trace);
103
EST_write_status
104
save_CSMM_set(
CSMM_set
&model_set,
const
EST_String
&
dirname
,
const
EST_String
&type);
105
106
EST_read_status
107
load_CSMM_set(
CSMM_set
&model_set,
const
EST_String
&
dirname
);
108
109
double
110
CSMM_Mahalanobis_distance(
const
CSMM
&
model
,
const
EST_Track
&t);
CSMM
Definition
EST_dynamic_model.h:48
EST_DMatrix
Definition
EST_DMatrix.h:54
EST_Hash_Pair
Definition
EST_THash.h:75
EST_String
Definition
EST_String.h:70
EST_THandle< Boxed_EST_DMatrix, EST_DMatrix >
EST_TList
Definition
EST_TList.h:109
EST_Track
Definition
EST_Track.h:89
CSMM_parameter_set
somewhere to keep the model parameters
Definition
EST_dynamic_model.h:65
CSMM_set
somewhere to keep the models
Definition
EST_dynamic_model.h:72
stats_accumulator
an accumulator to be owned by every model
Definition
EST_model_types.h:79
include
EST_dynamic_model.h
Generated on Tue Mar 12 2024 07:03:34 for Edinburgh Speech Tools by
1.9.8