tesseract
5.0.0-alpha-619-ge9db
|
#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 Pix *pix, TRand *randomizer) |
void | FromPixes (const StaticShape &shape, const std::vector< const Pix * > &pixes, TRand *randomizer) |
void | Copy2DImage (int batch, Pix *pix, float black, float contrast, TRand *randomizer) |
void | Copy1DGreyImage (int batch, Pix *pix, float black, float contrast, TRand *randomizer) |
void | SetPixel (int t, int f, int pixel, float black, float contrast) |
Pix * | 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 | ZeroTimeStepGeneral (int t, int offset, int num_features) |
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 GenericVector< int > &labels, int start, int end) const |
double | ScoreOfLabels (const GenericVector< 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, double *output) const |
void | AddTimeStep (int t, double *inout) const |
void | AddTimeStepPart (int t, int offset, int num_features, float *inout) const |
void | WriteTimeStep (int t, const double *input) |
void | WriteTimeStepPart (int t, int offset, int num_features, const double *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, double *product) |
template<class Func > | |
void | FuncMultiply3 (int u_t, const NetworkIO &v_io, int v_t, const double *w, double *product) const |
template<class Func > | |
void | FuncMultiply3Add (const NetworkIO &v_io, int t, const double *w, double *product) const |
template<class Func1 , class Func2 > | |
void | Func2Multiply3 (const NetworkIO &v_io, int t, const double *w, double *product) const |
Static Public Member Functions | |
static float | ProbToCertainty (float prob) |
Definition at line 39 of file networkio.h.
|
inline |
Definition at line 41 of file networkio.h.
void tesseract::NetworkIO::AddAllToFloat | ( | const NetworkIO & | src | ) |
Definition at line 817 of file networkio.cpp.
void tesseract::NetworkIO::AddTimeStep | ( | int | t, |
double * | inout | ||
) | const |
Definition at line 613 of file networkio.cpp.
void tesseract::NetworkIO::AddTimeStepPart | ( | int | t, |
int | offset, | ||
int | num_features, | ||
float * | inout | ||
) | const |
Definition at line 629 of file networkio.cpp.
bool tesseract::NetworkIO::AnySuspiciousTruth | ( | float | confidence_thr | ) | const |
Definition at line 579 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 431 of file networkio.cpp.
|
inline |
Definition at line 161 of file networkio.h.
int tesseract::NetworkIO::BestLabel | ( | int | t, |
int | not_this, | ||
int | not_that, | ||
float * | score | ||
) | const |
Definition at line 489 of file networkio.cpp.
void tesseract::NetworkIO::ClipVector | ( | int | t, |
float | range | ||
) |
Definition at line 971 of file networkio.cpp.
void tesseract::NetworkIO::CombineOutputs | ( | const NetworkIO & | base_output, |
const NetworkIO & | combiner_output | ||
) |
Definition at line 736 of file networkio.cpp.
void tesseract::NetworkIO::ComputeCombinerDeltas | ( | const NetworkIO & | fwd_deltas, |
const NetworkIO & | base_output | ||
) |
Definition at line 770 of file networkio.cpp.
void tesseract::NetworkIO::Copy1DGreyImage | ( | int | batch, |
Pix * | pix, | ||
float | black, | ||
float | contrast, | ||
TRand * | randomizer | ||
) |
Definition at line 246 of file networkio.cpp.
void tesseract::NetworkIO::Copy2DImage | ( | int | batch, |
Pix * | pix, | ||
float | black, | ||
float | contrast, | ||
TRand * | randomizer | ||
) |
Definition at line 208 of file networkio.cpp.
void tesseract::NetworkIO::CopyAll | ( | const NetworkIO & | src | ) |
Definition at line 811 of file networkio.cpp.
int tesseract::NetworkIO::CopyPacking | ( | const NetworkIO & | src, |
int | feature_offset | ||
) |
Definition at line 917 of file networkio.cpp.
void tesseract::NetworkIO::CopyTimeStepFrom | ( | int | dest_t, |
const NetworkIO & | src, | ||
int | src_t | ||
) |
Definition at line 383 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 393 of file networkio.cpp.
void tesseract::NetworkIO::CopyUnpacking | ( | const NetworkIO & | src, |
int | feature_offset, | ||
int | num_features | ||
) |
Definition at line 945 of file networkio.cpp.
Definition at line 831 of file networkio.cpp.
void tesseract::NetworkIO::CopyWithXReversal | ( | const NetworkIO & | src | ) |
Definition at line 872 of file networkio.cpp.
void tesseract::NetworkIO::CopyWithXYTranspose | ( | const NetworkIO & | src | ) |
Definition at line 891 of file networkio.cpp.
void tesseract::NetworkIO::CopyWithYReversal | ( | const NetworkIO & | src | ) |
Definition at line 853 of file networkio.cpp.
void tesseract::NetworkIO::EnsureBestLabel | ( | int | t, |
int | label | ||
) |
Definition at line 549 of file networkio.cpp.
|
inline |
Definition at line 115 of file networkio.h.
|
inline |
Definition at line 119 of file networkio.h.
|
inline |
Definition at line 139 of file networkio.h.
void tesseract::NetworkIO::FromPix | ( | const StaticShape & | shape, |
const Pix * | pix, | ||
TRand * | randomizer | ||
) |
Definition at line 161 of file networkio.cpp.
void tesseract::NetworkIO::FromPixes | ( | const StaticShape & | shape, |
const std::vector< const Pix * > & | pixes, | ||
TRand * | randomizer | ||
) |
Definition at line 170 of file networkio.cpp.
|
inline |
Definition at line 315 of file networkio.h.
|
inline |
Definition at line 259 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 123 of file networkio.h.
|
inline |
Definition at line 127 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 695 of file networkio.cpp.
void tesseract::NetworkIO::MaxpoolTimeStep | ( | int | dest_t, |
const NetworkIO & | src, | ||
int | src_t, | ||
int * | max_line | ||
) |
Definition at line 668 of file networkio.cpp.
float tesseract::NetworkIO::MinOfMaxes | ( | ) | const |
Definition at line 712 of file networkio.cpp.
|
inline |
Definition at line 140 of file networkio.h.
|
inline |
Definition at line 111 of file networkio.h.
int tesseract::NetworkIO::PositionOfBestMatch | ( | const GenericVector< int > & | labels, |
int | start, | ||
int | end | ||
) | const |
Definition at line 507 of file networkio.cpp.
void tesseract::NetworkIO::Print | ( | int | num | ) | const |
Definition at line 366 of file networkio.cpp.
|
static |
Definition at line 568 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, |
double * | output | ||
) | const |
Definition at line 598 of file networkio.cpp.
|
inline |
Definition at line 45 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 52 of file networkio.h.
void tesseract::NetworkIO::ResizeScaled | ( | const NetworkIO & | src, |
int | x_scale, | ||
int | y_scale, | ||
int | num_features | ||
) |
Definition at line 62 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 70 of file networkio.cpp.
|
inline |
Definition at line 234 of file networkio.h.
double tesseract::NetworkIO::ScoreOfLabels | ( | const GenericVector< 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 450 of file networkio.cpp.
|
inline |
Definition at line 130 of file networkio.h.
|
inline |
Definition at line 136 of file networkio.h.
void tesseract::NetworkIO::SetActivations | ( | int | t, |
int | label, | ||
float | ok_score | ||
) |
Definition at line 537 of file networkio.cpp.
void tesseract::NetworkIO::SetPixel | ( | int | t, |
int | f, | ||
int | pixel, | ||
float | black, | ||
float | contrast | ||
) |
Definition at line 275 of file networkio.cpp.
|
inline |
Definition at line 133 of file networkio.h.
void tesseract::NetworkIO::SubtractAllFromFloat | ( | const NetworkIO & | src | ) |
Definition at line 824 of file networkio.cpp.
Pix * tesseract::NetworkIO::ToPix | ( | ) | const |
Definition at line 286 of file networkio.cpp.
void tesseract::NetworkIO::Transpose | ( | TransposedArray * | dest | ) | const |
Definition at line 964 of file networkio.cpp.
|
inline |
Definition at line 107 of file networkio.h.
void tesseract::NetworkIO::WriteTimeStep | ( | int | t, |
const double * | input | ||
) |
Definition at line 645 of file networkio.cpp.
void tesseract::NetworkIO::WriteTimeStepPart | ( | int | t, |
int | offset, | ||
int | num_features, | ||
const double * | input | ||
) |
Definition at line 651 of file networkio.cpp.
void tesseract::NetworkIO::Zero | ( | ) |
Definition at line 77 of file networkio.cpp.
void tesseract::NetworkIO::ZeroInvalidElements | ( | ) |
Definition at line 88 of file networkio.cpp.
|
inline |
Definition at line 148 of file networkio.h.
void tesseract::NetworkIO::ZeroTimeStepGeneral | ( | int | t, |
int | offset, | ||
int | num_features | ||
) |
Definition at line 407 of file networkio.cpp.