tesseract v5.3.3.20231005
|
#include <networkio.h>
Public Member Functions | |
NetworkIO () | |
void | Resize (const NetworkIO &src, int num_features) |
void | Resize2d (bool int_mode, int width, int num_features) |
void | ResizeFloat (const NetworkIO &src, int num_features) |
void | ResizeToMap (bool int_mode, const StrideMap &stride_map, int num_features) |
void | ResizeScaled (const NetworkIO &src, int x_scale, int y_scale, int num_features) |
void | ResizeXTo1 (const NetworkIO &src, int num_features) |
void | Zero () |
void | ZeroInvalidElements () |
void | FromPix (const StaticShape &shape, const Image pix, TRand *randomizer) |
void | FromPixes (const StaticShape &shape, const std::vector< Image > &pixes, TRand *randomizer) |
void | Copy2DImage (int batch, Image pix, float black, float contrast, TRand *randomizer) |
void | Copy1DGreyImage (int batch, Image pix, float black, float contrast, TRand *randomizer) |
void | SetPixel (int t, int f, int pixel, float black, float contrast) |
Image | ToPix () const |
void | Print (int num) const |
int | Width () const |
int | NumFeatures () const |
float * | f (int t) |
const float * | f (int t) const |
const int8_t * | i (int t) const |
bool | int_mode () const |
void | set_int_mode (bool is_quantized) |
const StrideMap & | stride_map () const |
void | set_stride_map (const StrideMap &map) |
const GENERIC_2D_ARRAY< float > & | float_array () const |
GENERIC_2D_ARRAY< float > * | mutable_float_array () |
void | CopyTimeStepFrom (int dest_t, const NetworkIO &src, int src_t) |
void | CopyTimeStepGeneral (int dest_t, int dest_offset, int num_features, const NetworkIO &src, int src_t, int src_offset) |
void | ZeroTimeStep (int t) |
void | Randomize (int t, int offset, int num_features, TRand *randomizer) |
int | BestChoiceOverRange (int t_start, int t_end, int not_this, int null_ch, float *rating, float *certainty) const |
void | ScoresOverRange (int t_start, int t_end, int choice, int null_ch, float *rating, float *certainty) const |
int | BestLabel (int t, float *score) const |
int | BestLabel (int t, int not_this, int not_that, float *score) const |
int | PositionOfBestMatch (const std::vector< int > &labels, int start, int end) const |
TFloat | ScoreOfLabels (const std::vector< int > &labels, int start) const |
void | SetActivations (int t, int label, float ok_score) |
void | EnsureBestLabel (int t, int label) |
bool | AnySuspiciousTruth (float confidence_thr) const |
void | ReadTimeStep (int t, TFloat *output) const |
void | AddTimeStep (int t, TFloat *inout) const |
void | AddTimeStepPart (int t, int offset, int num_features, float *inout) const |
void | WriteTimeStep (int t, const TFloat *input) |
void | WriteTimeStepPart (int t, int offset, int num_features, const TFloat *input) |
void | MaxpoolTimeStep (int dest_t, const NetworkIO &src, int src_t, int *max_line) |
void | MaxpoolBackward (const NetworkIO &fwd, const GENERIC_2D_ARRAY< int > &maxes) |
float | MinOfMaxes () const |
float | Max () const |
void | CombineOutputs (const NetworkIO &base_output, const NetworkIO &combiner_output) |
void | ComputeCombinerDeltas (const NetworkIO &fwd_deltas, const NetworkIO &base_output) |
void | CopyAll (const NetworkIO &src) |
void | AddAllToFloat (const NetworkIO &src) |
void | SubtractAllFromFloat (const NetworkIO &src) |
void | CopyWithNormalization (const NetworkIO &src, const NetworkIO &scale) |
void | ScaleFloatBy (float factor) |
void | CopyWithYReversal (const NetworkIO &src) |
void | CopyWithXReversal (const NetworkIO &src) |
void | CopyWithXYTranspose (const NetworkIO &src) |
int | CopyPacking (const NetworkIO &src, int feature_offset) |
void | CopyUnpacking (const NetworkIO &src, int feature_offset, int num_features) |
void | Transpose (TransposedArray *dest) const |
void | ClipVector (int t, float range) |
template<class Func > | |
void | FuncMultiply (const NetworkIO &v_io, int t, TFloat *product) |
template<class Func > | |
void | FuncMultiply3 (int u_t, const NetworkIO &v_io, int v_t, const TFloat *w, TFloat *product) const |
template<class Func > | |
void | FuncMultiply3Add (const NetworkIO &v_io, int t, const TFloat *w, TFloat *product) const |
template<class Func1 , class Func2 > | |
void | Func2Multiply3 (const NetworkIO &v_io, int t, const TFloat *w, TFloat *product) const |
Static Public Member Functions | |
static float | ProbToCertainty (float prob) |
Definition at line 38 of file networkio.h.
|
inline |
Definition at line 40 of file networkio.h.
void tesseract::NetworkIO::AddAllToFloat | ( | const NetworkIO & | src | ) |
Definition at line 831 of file networkio.cpp.
void tesseract::NetworkIO::AddTimeStep | ( | int | t, |
TFloat * | inout | ||
) | const |
Definition at line 625 of file networkio.cpp.
void tesseract::NetworkIO::AddTimeStepPart | ( | int | t, |
int | offset, | ||
int | num_features, | ||
float * | inout | ||
) | const |
Definition at line 641 of file networkio.cpp.
bool tesseract::NetworkIO::AnySuspiciousTruth | ( | float | confidence_thr | ) | const |
Definition at line 591 of file networkio.cpp.
int tesseract::NetworkIO::BestChoiceOverRange | ( | int | t_start, |
int | t_end, | ||
int | not_this, | ||
int | null_ch, | ||
float * | rating, | ||
float * | certainty | ||
) | const |
Definition at line 432 of file networkio.cpp.
|
inline |
Definition at line 165 of file networkio.h.
int tesseract::NetworkIO::BestLabel | ( | int | t, |
int | not_this, | ||
int | not_that, | ||
float * | score | ||
) | const |
Definition at line 501 of file networkio.cpp.
void tesseract::NetworkIO::ClipVector | ( | int | t, |
float | range | ||
) |
Definition at line 980 of file networkio.cpp.
void tesseract::NetworkIO::CombineOutputs | ( | const NetworkIO & | base_output, |
const NetworkIO & | combiner_output | ||
) |
Definition at line 749 of file networkio.cpp.
void tesseract::NetworkIO::ComputeCombinerDeltas | ( | const NetworkIO & | fwd_deltas, |
const NetworkIO & | base_output | ||
) |
Definition at line 781 of file networkio.cpp.
void tesseract::NetworkIO::Copy1DGreyImage | ( | int | batch, |
Image | pix, | ||
float | black, | ||
float | contrast, | ||
TRand * | randomizer | ||
) |
Definition at line 257 of file networkio.cpp.
void tesseract::NetworkIO::Copy2DImage | ( | int | batch, |
Image | pix, | ||
float | black, | ||
float | contrast, | ||
TRand * | randomizer | ||
) |
Definition at line 216 of file networkio.cpp.
void tesseract::NetworkIO::CopyAll | ( | const NetworkIO & | src | ) |
Definition at line 825 of file networkio.cpp.
int tesseract::NetworkIO::CopyPacking | ( | const NetworkIO & | src, |
int | feature_offset | ||
) |
Definition at line 929 of file networkio.cpp.
void tesseract::NetworkIO::CopyTimeStepFrom | ( | int | dest_t, |
const NetworkIO & | src, | ||
int | src_t | ||
) |
Definition at line 395 of file networkio.cpp.
void tesseract::NetworkIO::CopyTimeStepGeneral | ( | int | dest_t, |
int | dest_offset, | ||
int | num_features, | ||
const NetworkIO & | src, | ||
int | src_t, | ||
int | src_offset | ||
) |
Definition at line 405 of file networkio.cpp.
void tesseract::NetworkIO::CopyUnpacking | ( | const NetworkIO & | src, |
int | feature_offset, | ||
int | num_features | ||
) |
Definition at line 955 of file networkio.cpp.
Definition at line 845 of file networkio.cpp.
void tesseract::NetworkIO::CopyWithXReversal | ( | const NetworkIO & | src | ) |
Definition at line 888 of file networkio.cpp.
void tesseract::NetworkIO::CopyWithXYTranspose | ( | const NetworkIO & | src | ) |
Definition at line 906 of file networkio.cpp.
void tesseract::NetworkIO::CopyWithYReversal | ( | const NetworkIO & | src | ) |
Definition at line 868 of file networkio.cpp.
void tesseract::NetworkIO::EnsureBestLabel | ( | int | t, |
int | label | ||
) |
Definition at line 561 of file networkio.cpp.
|
inline |
Definition at line 110 of file networkio.h.
|
inline |
Definition at line 114 of file networkio.h.
|
inline |
Definition at line 134 of file networkio.h.
void tesseract::NetworkIO::FromPix | ( | const StaticShape & | shape, |
const Image | pix, | ||
TRand * | randomizer | ||
) |
Definition at line 163 of file networkio.cpp.
void tesseract::NetworkIO::FromPixes | ( | const StaticShape & | shape, |
const std::vector< Image > & | pixes, | ||
TRand * | randomizer | ||
) |
Definition at line 171 of file networkio.cpp.
|
inline |
Definition at line 314 of file networkio.h.
|
inline |
Definition at line 260 of file networkio.h.
|
inline |
Definition at line 283 of file networkio.h.
|
inline |
Definition at line 299 of file networkio.h.
|
inline |
Definition at line 118 of file networkio.h.
|
inline |
Definition at line 122 of file networkio.h.
|
inline |
Definition at line 215 of file networkio.h.
void tesseract::NetworkIO::MaxpoolBackward | ( | const NetworkIO & | fwd, |
const GENERIC_2D_ARRAY< int > & | maxes | ||
) |
Definition at line 703 of file networkio.cpp.
void tesseract::NetworkIO::MaxpoolTimeStep | ( | int | dest_t, |
const NetworkIO & | src, | ||
int | src_t, | ||
int * | max_line | ||
) |
Definition at line 677 of file networkio.cpp.
float tesseract::NetworkIO::MinOfMaxes | ( | ) | const |
Definition at line 719 of file networkio.cpp.
|
inline |
Definition at line 137 of file networkio.h.
|
inline |
Definition at line 106 of file networkio.h.
int tesseract::NetworkIO::PositionOfBestMatch | ( | const std::vector< int > & | labels, |
int | start, | ||
int | end | ||
) | const |
Definition at line 520 of file networkio.cpp.
void tesseract::NetworkIO::Print | ( | int | num | ) | const |
Definition at line 378 of file networkio.cpp.
|
static |
Definition at line 580 of file networkio.cpp.
void tesseract::NetworkIO::Randomize | ( | int | t, |
int | offset, | ||
int | num_features, | ||
TRand * | randomizer | ||
) |
Definition at line 416 of file networkio.cpp.
void tesseract::NetworkIO::ReadTimeStep | ( | int | t, |
TFloat * | output | ||
) | const |
Definition at line 610 of file networkio.cpp.
|
inline |
Definition at line 44 of file networkio.h.
void tesseract::NetworkIO::Resize2d | ( | bool | int_mode, |
int | width, | ||
int | num_features | ||
) |
Definition at line 35 of file networkio.cpp.
|
inline |
Definition at line 51 of file networkio.h.
void tesseract::NetworkIO::ResizeScaled | ( | const NetworkIO & | src, |
int | x_scale, | ||
int | y_scale, | ||
int | num_features | ||
) |
Definition at line 61 of file networkio.cpp.
void tesseract::NetworkIO::ResizeToMap | ( | bool | int_mode, |
const StrideMap & | stride_map, | ||
int | num_features | ||
) |
Definition at line 46 of file networkio.cpp.
void tesseract::NetworkIO::ResizeXTo1 | ( | const NetworkIO & | src, |
int | num_features | ||
) |
Definition at line 68 of file networkio.cpp.
|
inline |
Definition at line 234 of file networkio.h.
TFloat tesseract::NetworkIO::ScoreOfLabels | ( | const std::vector< int > & | labels, |
int | start | ||
) | const |
void tesseract::NetworkIO::ScoresOverRange | ( | int | t_start, |
int | t_end, | ||
int | choice, | ||
int | null_ch, | ||
float * | rating, | ||
float * | certainty | ||
) | const |
Definition at line 454 of file networkio.cpp.
|
inline |
Definition at line 125 of file networkio.h.
|
inline |
Definition at line 131 of file networkio.h.
void tesseract::NetworkIO::SetActivations | ( | int | t, |
int | label, | ||
float | ok_score | ||
) |
Definition at line 548 of file networkio.cpp.
void tesseract::NetworkIO::SetPixel | ( | int | t, |
int | f, | ||
int | pixel, | ||
float | black, | ||
float | contrast | ||
) |
Definition at line 290 of file networkio.cpp.
|
inline |
Definition at line 128 of file networkio.h.
void tesseract::NetworkIO::SubtractAllFromFloat | ( | const NetworkIO & | src | ) |
Definition at line 838 of file networkio.cpp.
Image tesseract::NetworkIO::ToPix | ( | ) | const |
Definition at line 300 of file networkio.cpp.
void tesseract::NetworkIO::Transpose | ( | TransposedArray * | dest | ) | const |
Definition at line 971 of file networkio.cpp.
|
inline |
Definition at line 102 of file networkio.h.
void tesseract::NetworkIO::WriteTimeStep | ( | int | t, |
const TFloat * | input | ||
) |
Definition at line 656 of file networkio.cpp.
void tesseract::NetworkIO::WriteTimeStepPart | ( | int | t, |
int | offset, | ||
int | num_features, | ||
const TFloat * | input | ||
) |
Definition at line 662 of file networkio.cpp.
void tesseract::NetworkIO::Zero | ( | ) |
Definition at line 75 of file networkio.cpp.
void tesseract::NetworkIO::ZeroInvalidElements | ( | ) |
Definition at line 86 of file networkio.cpp.
|
inline |
Definition at line 147 of file networkio.h.