ZGen
0.2.0
a linearization system for natural language.
Main Page
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
shiftreduce
learning
learner.h
Go to the documentation of this file.
1
#ifndef __ZGEN_SHIFTREDUCE_LEARNER_H__
2
#define __ZGEN_SHIFTREDUCE_LEARNER_H__
3
4
#include "
shiftreduce/option.h
"
5
#include "
shiftreduce/types/state.h
"
6
#include "
shiftreduce/model/model.h
"
7
#include "
shiftreduce/decode/decode_context.h
"
8
9
namespace
ZGen {
10
namespace
ShiftReduce {
11
12
class
Learner
{
13
public
:
14
Learner
(
const
option_t
& opts,
15
Model
* model,
16
const
DecodeContext
* ctx);
17
23
void
set_timestamp
(
int
timestamp);
24
33
void
learn
(
const
StateItem
* last_state_of_predict_chain,
34
const
StateItem
* last_state_of_correct_chain);
35
42
void
finish_learning
(
int
now);
43
private
:
44
const
option_t
& opts;
45
int
timestamp;
46
Model
* model;
47
const
DecodeContext
* ctx;
48
const
StateItem
* predict_state_chain[
kMaxSteps
];
49
const
StateItem
* correct_state_chain[
kMaxSteps
];
50
};
51
52
}
// end for namespace ShiftReduce
53
}
// end for namespace ZGen
54
55
#endif // end for __ZGEN_SHIFTREDUCE_LEARNER_H__
ZGen::ShiftReduce::StateItem
Definition:
state.h:15
ZGen::ShiftReduce::Option
Definition:
option.h:10
ZGen::ShiftReduce::Model
Definition:
model.h:12
ZGen::ShiftReduce::Learner
Definition:
learner.h:12
ZGen::ShiftReduce::Learner::finish_learning
void finish_learning(int now)
decode_context.h
ZGen::ShiftReduce::DecodeContext
Used to maintain the memory cache used by the decoder.
Definition:
decode_context.h:9
ZGen::ShiftReduce::Learner::learn
void learn(const StateItem *last_state_of_predict_chain, const StateItem *last_state_of_correct_chain)
Definition:
learner.cc:22
ZGen::ShiftReduce::Learner::Learner
Learner(const option_t &opts, Model *model, const DecodeContext *ctx)
Definition:
learner.cc:7
ZGen::ShiftReduce::Learner::set_timestamp
void set_timestamp(int timestamp)
Definition:
learner.cc:17
state.h
ZGen::ShiftReduce::kMaxSteps
const int kMaxSteps
Definition:
settings.h:10
model.h
option.h
Generated by
1.8.6