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

#include <plumbing.h>

Inheritance diagram for tesseract::Plumbing:
Collaboration diagram for tesseract::Plumbing:

Public Member Functions

 Plumbing (const STRING &name)
 
virtual ~Plumbing ()=default
 
StaticShape InputShape () const override
 
STRING spec () const override
 
bool IsPlumbingType () const override
 
void SetEnableTraining (TrainingState state) override
 
void SetNetworkFlags (uint32_t flags) override
 
int InitWeights (float range, TRand *randomizer) override
 
int RemapOutputs (int old_no, const std::vector< int > &code_map) override
 
void ConvertToInt () override
 
void SetRandomizer (TRand *randomizer) override
 
virtual void AddToStack (Network *network)
 
bool SetupNeedsBackprop (bool needs_backprop) override
 
int XScaleFactor () const override
 
void CacheXScaleFactor (int factor) override
 
void DebugWeights () override
 
const PointerVector< Network > & stack () const
 
void EnumerateLayers (const STRING *prefix, GenericVector< STRING > *layers) const
 
NetworkGetLayer (const char *id) const
 
float LayerLearningRate (const char *id) const
 
void ScaleLayerLearningRate (const char *id, double factor)
 
float * LayerLearningRatePtr (const char *id) const
 
bool Serialize (TFile *fp) const override
 
bool DeSerialize (TFile *fp) override
 
void Update (float learning_rate, float momentum, float adam_beta, int num_samples) override
 
void CountAlternators (const Network &other, double *same, double *changed) const 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
 
virtual StaticShape OutputShape (const StaticShape &input_shape) const
 
const STRINGname () const
 
bool TestFlag (NetworkFlags flag) const
 
virtual void Forward (bool debug, const NetworkIO &input, const TransposedArray *input_transpose, NetworkScratch *scratch, NetworkIO *output)
 
virtual bool Backward (bool debug, const NetworkIO &fwd_deltas, NetworkScratch *scratch, NetworkIO *back_deltas)
 
void DisplayForward (const NetworkIO &matrix)
 
void DisplayBackward (const NetworkIO &matrix)
 

Protected Attributes

PointerVector< Networkstack_
 
GenericVector< float > learning_rates_
 
- 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_
 
ScrollViewforward_win_
 
ScrollViewbackward_win_
 
TRandrandomizer_
 

Additional Inherited Members

- Static Public Member Functions inherited from tesseract::Network
static NetworkCreateFromFile (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)
 
- Protected Member Functions inherited from tesseract::Network
double Random (double range)
 
- Static Protected Attributes inherited from tesseract::Network
static char const *const kTypeNames [NT_COUNT]
 

Constructor & Destructor Documentation

◆ Plumbing()

tesseract::Plumbing::Plumbing ( const STRING name)
explicit

◆ ~Plumbing()

virtual tesseract::Plumbing::~Plumbing ( )
virtualdefault

Member Function Documentation

◆ AddToStack()

void tesseract::Plumbing::AddToStack ( Network network)
virtual

◆ CacheXScaleFactor()

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

Reimplemented from tesseract::Network.

Reimplemented in tesseract::Series.

◆ ConvertToInt()

void tesseract::Plumbing::ConvertToInt ( )
overridevirtual

Reimplemented from tesseract::Network.

◆ CountAlternators()

void tesseract::Plumbing::CountAlternators ( const Network other,
double *  same,
double *  changed 
) const
overridevirtual

Reimplemented from tesseract::Network.

◆ DebugWeights()

void tesseract::Plumbing::DebugWeights ( )
overridevirtual

Reimplemented from tesseract::Network.

◆ DeSerialize()

bool tesseract::Plumbing::DeSerialize ( TFile fp)
overridevirtual

Reimplemented from tesseract::Network.

◆ EnumerateLayers()

void tesseract::Plumbing::EnumerateLayers ( const STRING prefix,
GenericVector< STRING > *  layers 
) const

◆ GetLayer()

Network * tesseract::Plumbing::GetLayer ( const char *  id) const

◆ InitWeights()

int tesseract::Plumbing::InitWeights ( float  range,
TRand randomizer 
)
overridevirtual

Reimplemented from tesseract::Network.

Reimplemented in tesseract::Series.

◆ InputShape()

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

Reimplemented from tesseract::Network.

◆ IsPlumbingType()

bool tesseract::Plumbing::IsPlumbingType ( ) const
inlineoverridevirtual

Reimplemented from tesseract::Network.

◆ LayerLearningRate()

float tesseract::Plumbing::LayerLearningRate ( const char *  id) const
inline

◆ LayerLearningRatePtr()

float * tesseract::Plumbing::LayerLearningRatePtr ( const char *  id) const

◆ RemapOutputs()

int tesseract::Plumbing::RemapOutputs ( int  old_no,
const std::vector< int > &  code_map 
)
overridevirtual

Reimplemented from tesseract::Network.

Reimplemented in tesseract::Series.

◆ ScaleLayerLearningRate()

void tesseract::Plumbing::ScaleLayerLearningRate ( const char *  id,
double  factor 
)
inline

◆ Serialize()

bool tesseract::Plumbing::Serialize ( TFile fp) const
overridevirtual

Reimplemented from tesseract::Network.

◆ SetEnableTraining()

void tesseract::Plumbing::SetEnableTraining ( TrainingState  state)
overridevirtual

Reimplemented from tesseract::Network.

◆ SetNetworkFlags()

void tesseract::Plumbing::SetNetworkFlags ( uint32_t  flags)
overridevirtual

Reimplemented from tesseract::Network.

◆ SetRandomizer()

void tesseract::Plumbing::SetRandomizer ( TRand randomizer)
overridevirtual

Reimplemented from tesseract::Network.

◆ SetupNeedsBackprop()

bool tesseract::Plumbing::SetupNeedsBackprop ( bool  needs_backprop)
overridevirtual

Reimplemented from tesseract::Network.

Reimplemented in tesseract::Series.

◆ spec()

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

Reimplemented from tesseract::Network.

Reimplemented in tesseract::Reversed, and tesseract::Series.

◆ stack()

const PointerVector<Network>& tesseract::Plumbing::stack ( ) const
inline

◆ Update()

void tesseract::Plumbing::Update ( float  learning_rate,
float  momentum,
float  adam_beta,
int  num_samples 
)
overridevirtual

Reimplemented from tesseract::Network.

◆ XScaleFactor()

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

Reimplemented from tesseract::Network.

Reimplemented in tesseract::Series.

Member Data Documentation

◆ learning_rates_

GenericVector<float> tesseract::Plumbing::learning_rates_
protected

◆ stack_

PointerVector<Network> tesseract::Plumbing::stack_
protected

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