#include <ctc.h>
Definition at line 30 of file ctc.h.
◆ ComputeCTCTargets()
bool tesseract::CTC::ComputeCTCTargets |
( |
const std::vector< int > & |
truth_labels, |
|
|
int |
null_char, |
|
|
const GENERIC_2D_ARRAY< float > & |
outputs, |
|
|
NetworkIO * |
targets |
|
) |
| |
|
static |
Definition at line 53 of file ctc.cpp.
55 std::unique_ptr<CTC> ctc(
new CTC(labels, null_char, outputs));
56 if (!ctc->ComputeLabelLimits()) {
61 GENERIC_2D_ARRAY<float> simple_targets;
62 ctc->ComputeSimpleTargets(&simple_targets);
64 float bias_fraction = ctc->CalculateBiasFraction();
65 simple_targets *= bias_fraction;
66 ctc->outputs_ += simple_targets;
70 GENERIC_2D_ARRAY<double> log_alphas, log_betas;
71 ctc->Forward(&log_alphas);
72 ctc->Backward(&log_betas);
74 log_alphas += log_betas;
75 ctc->NormalizeSequence(&log_alphas);
76 ctc->LabelsToClasses(log_alphas, targets);
static void NormalizeProbs(NetworkIO *probs)
◆ NormalizeProbs()
static void tesseract::CTC::NormalizeProbs |
( |
NetworkIO * |
probs | ) |
|
|
inlinestatic |
Definition at line 36 of file ctc.h.
The documentation for this class was generated from the following files: