20 #ifndef TESSERACT_LSTM_PLUMBING_H_ 21 #define TESSERACT_LSTM_PLUMBING_H_ 23 #include "genericvector.h" 39 return "Sub-classes of Plumbing must implement spec()!";
62 int RemapOutputs(
int old_no,
const std::vector<int>& code_map)
override;
107 ASSERT_HOST(lr_ptr !=
nullptr);
113 ASSERT_HOST(lr_ptr !=
nullptr);
126 void Update(
float learning_rate,
float momentum,
float adam_beta,
127 int num_samples)
override;
132 double* changed)
const override;
144 #endif // TESSERACT_LSTM_PLUMBING_H_ int InitWeights(float range, TRand *randomizer) override
Definition: plumbing.cpp:50
bool DeSerialize(TFile *fp) override
Definition: plumbing.cpp:197
void ScaleLayerLearningRate(const char *id, double factor)
Definition: plumbing.h:111
void SetEnableTraining(TrainingState state) override
Definition: plumbing.cpp:31
bool SetupNeedsBackprop(bool needs_backprop) override
Definition: plumbing.cpp:100
PointerVector< Network > stack_
Definition: plumbing.h:136
Definition: static_shape.h:38
void Update(float learning_rate, float momentum, float adam_beta, int num_samples) override
Definition: plumbing.cpp:216
Definition: plumbing.h:30
Definition: serialis.h:77
int RemapOutputs(int old_no, const std::vector< int > &code_map) override
Definition: plumbing.cpp:59
void EnumerateLayers(const STRING *prefix, GenericVector< STRING > *layers) const
Definition: plumbing.cpp:139
void CountAlternators(const Network &other, double *same, double *changed) const override
Definition: plumbing.cpp:234
Definition: baseapi.cpp:94
const STRING & name() const
Definition: network.h:138
Network * GetLayer(const char *id) const
Definition: plumbing.cpp:155
float * LayerLearningRatePtr(const char *id) const
Definition: plumbing.cpp:168
void SetRandomizer(TRand *randomizer) override
Definition: plumbing.cpp:76
Definition: network.h:105
STRING spec() const override
Definition: plumbing.h:38
void SetNetworkFlags(uint32_t flags) override
Definition: plumbing.cpp:39
bool Serialize(TFile *fp) const override
Definition: plumbing.cpp:182
void CacheXScaleFactor(int factor) override
Definition: plumbing.cpp:126
StaticShape InputShape() const override
Definition: plumbing.h:37
bool IsPlumbingType() const override
Definition: plumbing.h:44
GenericVector< float > learning_rates_
Definition: plumbing.h:139
Plumbing(const STRING &name)
Definition: plumbing.cpp:25
float LayerLearningRate(const char *id) const
Definition: plumbing.h:105
TrainingState
Definition: network.h:92
Definition: genericvector.h:457
virtual void AddToStack(Network *network)
Definition: plumbing.cpp:82
virtual ~Plumbing()=default
int XScaleFactor() const override
Definition: plumbing.cpp:120
void ConvertToInt() override
Definition: plumbing.cpp:68
const PointerVector< Network > & stack() const
Definition: plumbing.h:96
void DebugWeights() override
Definition: plumbing.cpp:133