#include <network.h>
Public Member Functions | |
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 | InputShape () const |
virtual StaticShape | OutputShape (const StaticShape &input_shape) const |
const STRING & | name () const |
virtual STRING | spec () 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 int | XScaleFactor () const |
virtual void | CacheXScaleFactor (int factor) |
virtual void | DebugWeights () |
virtual bool | Serialize (TFile *fp) const |
virtual bool | DeSerialize (TFile *fp) |
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 |
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) |
Static Public Member Functions | |
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) |
Protected Member Functions | |
double | Random (double range) |
Protected Attributes | |
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 | |
static char const *const | kTypeNames [NT_COUNT] |
tesseract::Network::Network | ( | ) |
tesseract::Network::Network | ( | NetworkType | type, |
const STRING & | name, | ||
int | ni, | ||
int | no | ||
) |
|
virtualdefault |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in tesseract::Plumbing, tesseract::Series, and tesseract::Input.
|
static |
|
inlinevirtual |
Reimplemented in tesseract::LSTM, tesseract::FullyConnected, and tesseract::Plumbing.
|
inlinevirtual |
Reimplemented in tesseract::Plumbing, tesseract::FullyConnected, and tesseract::LSTM.
|
inlinevirtual |
Reimplemented in tesseract::Plumbing, tesseract::LSTM, and tesseract::FullyConnected.
|
virtual |
Reimplemented in tesseract::Plumbing, tesseract::LSTM, tesseract::FullyConnected, tesseract::Reconfig, tesseract::Input, tesseract::Convolve, and tesseract::Maxpool.
void tesseract::Network::DisplayBackward | ( | const NetworkIO & | matrix | ) |
void tesseract::Network::DisplayForward | ( | const NetworkIO & | matrix | ) |
|
static |
|
inlinevirtual |
|
virtual |
Reimplemented in tesseract::LSTM, tesseract::FullyConnected, tesseract::Plumbing, and tesseract::Series.
|
inlinevirtual |
Reimplemented in tesseract::Input, and tesseract::Plumbing.
|
inlinevirtual |
Reimplemented in tesseract::Plumbing.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in tesseract::LSTM, tesseract::Input, tesseract::Reconfig, tesseract::FullyConnected, tesseract::Parallel, tesseract::Reversed, and tesseract::Series.
|
protected |
|
inlinevirtual |
Reimplemented in tesseract::LSTM, tesseract::FullyConnected, tesseract::Plumbing, and tesseract::Series.
|
virtual |
Reimplemented in tesseract::Plumbing, tesseract::LSTM, tesseract::FullyConnected, tesseract::Reconfig, tesseract::Input, and tesseract::Convolve.
|
virtual |
Reimplemented in tesseract::LSTM, tesseract::FullyConnected, and tesseract::Plumbing.
|
virtual |
Reimplemented in tesseract::Plumbing.
|
virtual |
Reimplemented in tesseract::Plumbing.
|
virtual |
Reimplemented in tesseract::Plumbing, and tesseract::Series.
|
inlinevirtual |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in tesseract::Plumbing, tesseract::FullyConnected, and tesseract::LSTM.
|
inlinevirtual |
Reimplemented in tesseract::Plumbing, tesseract::Series, tesseract::Input, and tesseract::Reconfig.
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |