Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmTrain.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmTrain.h
4
* Author: Bryan Jurish <moocow.bovine@gmail.com>
5
* Description: finite state machine library
6
*
7
* Copyright (c) 2014 Bryan Jurish.
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 3 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
*=============================================================================*/
23
28
#ifndef _GFSM_TRAIN_H
29
#define _GFSM_TRAIN_H
30
31
#include <
gfsmAutomaton.h
>
32
#include <
gfsmUtils.h
>
33
34
/*======================================================================
35
* Types: train
36
*/
38
typedef
struct
{
42
gboolean
bestPathsOnly
;
43
49
gboolean
prunePathPermutations
;
50
56
gboolean
distributeOverPaths
;
57
63
gboolean
distributeOverArcs
;
64
68
gfsmAutomaton
*
fst
;
69
73
guint
nweights
;
74
78
gfsmWeight
*
weights
;
79
83
gfsmWeight
*
counts
;
84
85
}
gfsmTrainer
;
86
87
89
typedef
struct
gfsmTrainConfig_
{
90
guint32
i
;
91
guint32
j
;
92
gfsmStateId
qf
;
93
gfsmArc
*
a
;
94
struct
gfsmTrainConfig_
*
prev
;
95
}
gfsmTrainConfig
;
96
98
typedef
GPtrArray
gfsmTrainPath
;
99
100
101
/*======================================================================
102
* Methods: training: top-level
103
*/
104
105
//------------------------------
111
gfsmTrainer
*
gfsm_trainer_new
(
gfsmAutomaton
*fst);
112
113
//------------------------------
117
void
gfsm_trainer_free
(
gfsmTrainer
*trainer, gboolean free_fst);
118
119
//------------------------------
127
gfsmAutomaton
*
gfsm_trainer_automaton
(
gfsmTrainer
*trainer, gboolean steal);
128
129
//------------------------------
141
void
gfsm_trainer_train
(
gfsmTrainer
*trainer,
gfsmLabelVector
*input,
gfsmLabelVector
*output);
142
143
#endif
/* _GFSM_TRAIN_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2