~ubuntu-branches/ubuntu/saucy/sphinxtrain/saucy

« back to all changes in this revision

Viewing changes to src/programs/bw/viterbi.h

  • Committer: Package Import Robot
  • Author(s): Samuel Thibault
  • Date: 2013-01-02 04:10:21 UTC
  • Revision ID: package-import@ubuntu.com-20130102041021-ynsizmz33fx02hea
Tags: upstream-1.0.8
ImportĀ upstreamĀ versionĀ 1.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ====================================================================
 
2
 * Copyright (c) 1996-2000 Carnegie Mellon University.  All rights 
 
3
 * reserved.
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 *
 
9
 * 1. Redistributions of source code must retain the above copyright
 
10
 *    notice, this list of conditions and the following disclaimer. 
 
11
 *
 
12
 * 2. Redistributions in binary form must reproduce the above copyright
 
13
 *    notice, this list of conditions and the following disclaimer in
 
14
 *    the documentation and/or other materials provided with the
 
15
 *    distribution.
 
16
 *
 
17
 * This work was supported in part by funding from the Defense Advanced 
 
18
 * Research Projects Agency and the National Science Foundation of the 
 
19
 * United States of America, and the CMU Sphinx Speech Consortium.
 
20
 *
 
21
 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
 
22
 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 
23
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
24
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
 
25
 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
26
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 
27
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 
28
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 
29
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 
30
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 
31
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
32
 *
 
33
 * ====================================================================
 
34
 *
 
35
 */
 
36
/*********************************************************************
 
37
 *
 
38
 * File: viterbi.h
 
39
 * 
 
40
 * Description: 
 
41
 * 
 
42
 * Author: 
 
43
 *      Eric H. Thayer
 
44
 *********************************************************************/
 
45
 
 
46
#ifndef VITERBI_H
 
47
#define VITERBI_H
 
48
 
 
49
#include <sphinxbase/prim_type.h>
 
50
#include <sphinxbase/feat.h>
 
51
 
 
52
#include <s3/vector.h>
 
53
#include <s3/state.h>
 
54
#include <s3/model_inventory.h>
 
55
#include <s3/s3phseg_io.h>
 
56
 
 
57
#include "baum_welch.h"
 
58
 
 
59
int32
 
60
write_phseg(const char *filename,
 
61
            model_inventory_t *modinv,
 
62
            state_t *state_seq,
 
63
            uint32 **active_astate,
 
64
            uint32 *n_active_astate,
 
65
            uint32 n_state,
 
66
            uint32 n_obs,
 
67
            float64 **active_alpha,
 
68
            float64 *scale,
 
69
            uint32 **bp);
 
70
 
 
71
int32
 
72
write_s2stseg(const char *filename,
 
73
              state_t *state_seq,
 
74
              uint32 **active_astate,
 
75
              uint32 *n_active_astate,
 
76
              uint32 n_state,
 
77
              uint32 n_obs,
 
78
              uint32 **bp);
 
79
 
 
80
int32
 
81
viterbi_update(float64 *log_forw_prob,
 
82
               vector_t **feature,
 
83
               uint32 n_obs,
 
84
               state_t *state,
 
85
               uint32 n_state,
 
86
               model_inventory_t *inv,
 
87
               float64 a_beam,
 
88
               float32 spthresh,
 
89
               s3phseg_t *phseg,
 
90
               int32 mixw_reest,
 
91
               int32 tmat_reest,
 
92
               int32 mean_reest,
 
93
               int32 var_reest,
 
94
               int32 pass2var,
 
95
               int32 var_is_full,
 
96
               FILE *pdumpfh,
 
97
               bw_timers_t *timers,
 
98
               feat_t *fcb);
 
99
 
 
100
int32
 
101
mmi_viterbi_run(float64 *log_forw_prob,
 
102
                vector_t **feature,
 
103
                uint32 n_obs,
 
104
                state_t *state,
 
105
                uint32 n_state,
 
106
                model_inventory_t *inv,
 
107
                float64 a_beam);
 
108
 
 
109
int32
 
110
mmi_viterbi_update(vector_t **feature,
 
111
                   uint32 n_obs,
 
112
                   state_t *state,
 
113
                   uint32 n_state,
 
114
                   model_inventory_t *inv,
 
115
                   float64 a_beam,
 
116
                   int32 mean_reest,
 
117
                   int32 var_reest,
 
118
                   float64 arc_gamma,
 
119
                   feat_t *fcb);
 
120
 
 
121
#endif /* VITERBI_H */ 
 
122