tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::Input Class Reference

#include <input.h>

Inheritance diagram for tesseract::Input:
Collaboration diagram for tesseract::Input:

Public Member Functions

 Input (const STRING &name, int ni, int no)
 
 Input (const STRING &name, const StaticShape &shape)
 
virtual ~Input ()=default
 
STRING spec () const override
 
StaticShape InputShape () const override
 
StaticShape OutputShape (const StaticShape &input_shape) const override
 
bool Serialize (TFile *fp) const override
 
bool DeSerialize (TFile *fp) override
 
int XScaleFactor () const override
 
void CacheXScaleFactor (int factor) override
 
void Forward (bool debug, const NetworkIO &input, const TransposedArray *input_transpose, NetworkScratch *scratch, NetworkIO *output) override
 
bool Backward (bool debug, const NetworkIO &fwd_deltas, NetworkScratch *scratch, NetworkIO *back_deltas) override
 
- Public Member Functions inherited from tesseract::Network
 Network ()
 
 Network (NetworkType type, const STRING &name, int ni, int no)
 
virtual ~Network ()=default
 
NetworkType type () const
 
bool IsTraining () const
 
bool needs_to_backprop () const
 
int num_weights () const
 
int NumInputs () const
 
int NumOutputs () const
 
const STRING & name () const
 
bool TestFlag (NetworkFlags flag) const
 
virtual bool IsPlumbingType () const
 
virtual void SetEnableTraining (TrainingState state)
 
virtual void SetNetworkFlags (uint32_t flags)
 
virtual int InitWeights (float range, TRand *randomizer)
 
virtual int RemapOutputs (int old_no, const std::vector< int > &code_map)
 
virtual void ConvertToInt ()
 
virtual void SetRandomizer (TRand *randomizer)
 
virtual bool SetupNeedsBackprop (bool needs_backprop)
 
virtual void DebugWeights ()
 
virtual void Update (float learning_rate, float momentum, float adam_beta, int num_samples)
 
virtual void CountAlternators (const Network &other, double *same, double *changed) const
 
void DisplayForward (const NetworkIO &matrix)
 
void DisplayBackward (const NetworkIO &matrix)
 

Static Public Member Functions

static Pix * PrepareLSTMInputs (const ImageData &image_data, const Network *network, int min_width, TRand *randomizer, float *image_scale)
 
static void PreparePixInput (const StaticShape &shape, const Pix *pix, TRand *randomizer, NetworkIO *input)
 
- Static Public Member Functions inherited from tesseract::Network
static Network * CreateFromFile (TFile *fp)
 
static void ClearWindow (bool tess_coords, const char *window_name, int width, int height, ScrollView **window)
 
static int DisplayImage (Pix *pix, ScrollView *window)
 

Private Attributes

StaticShape shape_
 
int cached_x_scale_
 

Additional Inherited Members

- Protected Member Functions inherited from tesseract::Network
double Random (double range)
 
- Protected Attributes inherited from tesseract::Network
NetworkType type_
 
TrainingState training_
 
bool needs_to_backprop_
 
int32_t network_flags_
 
int32_t ni_
 
int32_t no_
 
int32_t num_weights_
 
STRING name_
 
ScrollView * forward_win_
 
ScrollView * backward_win_
 
TRand * randomizer_
 
- Static Protected Attributes inherited from tesseract::Network
static char const *const kTypeNames [NT_COUNT]
 

Constructor & Destructor Documentation

◆ Input() [1/2]

tesseract::Input::Input ( const STRING &  name,
int  ni,
int  no 
)

◆ Input() [2/2]

tesseract::Input::Input ( const STRING &  name,
const StaticShape &  shape 
)

◆ ~Input()

virtual tesseract::Input::~Input ( )
virtualdefault

Member Function Documentation

◆ Backward()

bool tesseract::Input::Backward ( bool  debug,
const NetworkIO &  fwd_deltas,
NetworkScratch *  scratch,
NetworkIO *  back_deltas 
)
overridevirtual

Reimplemented from tesseract::Network.

◆ CacheXScaleFactor()

void tesseract::Input::CacheXScaleFactor ( int  factor)
overridevirtual

Reimplemented from tesseract::Network.

◆ DeSerialize()

bool tesseract::Input::DeSerialize ( TFile *  fp)
overridevirtual

Reimplemented from tesseract::Network.

◆ Forward()

void tesseract::Input::Forward ( bool  debug,
const NetworkIO &  input,
const TransposedArray *  input_transpose,
NetworkScratch *  scratch,
NetworkIO *  output 
)
overridevirtual

Reimplemented from tesseract::Network.

◆ InputShape()

StaticShape tesseract::Input::InputShape ( ) const
inlineoverridevirtual

Reimplemented from tesseract::Network.

◆ OutputShape()

StaticShape tesseract::Input::OutputShape ( const StaticShape &  input_shape) const
inlineoverridevirtual

Reimplemented from tesseract::Network.

◆ PrepareLSTMInputs()

Pix * tesseract::Input::PrepareLSTMInputs ( const ImageData &  image_data,
const Network *  network,
int  min_width,
TRand *  randomizer,
float *  image_scale 
)
static

◆ PreparePixInput()

void tesseract::Input::PreparePixInput ( const StaticShape &  shape,
const Pix *  pix,
TRand *  randomizer,
NetworkIO *  input 
)
static

◆ Serialize()

bool tesseract::Input::Serialize ( TFile *  fp) const
overridevirtual

Reimplemented from tesseract::Network.

◆ spec()

STRING tesseract::Input::spec ( ) const
inlineoverridevirtual

Reimplemented from tesseract::Network.

◆ XScaleFactor()

int tesseract::Input::XScaleFactor ( ) const
overridevirtual

Reimplemented from tesseract::Network.

Member Data Documentation

◆ cached_x_scale_

int tesseract::Input::cached_x_scale_
private

◆ shape_

StaticShape tesseract::Input::shape_
private

The documentation for this class was generated from the following files: