tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
33 for (
int i = 0; i <
stack_.size(); ++i)
41 for (
int i = 0; i <
stack_.size(); ++i)
52 for (
int i = 0; i <
stack_.size(); ++i)
61 for (
int i = 0; i <
stack_.size(); ++i) {
69 for (
int i = 0; i <
stack_.size(); ++i)
77 for (
int i = 0; i <
stack_.size(); ++i)
103 bool retval = needs_backprop;
104 for (
int i = 0; i <
stack_.size(); ++i) {
121 return stack_[0]->XScaleFactor();
127 for (
int i = 0; i <
stack_.size(); ++i) {
128 stack_[i]->CacheXScaleFactor(factor);
134 for (
int i = 0; i <
stack_.size(); ++i)
141 for (
int i = 0; i <
stack_.size(); ++i) {
143 if (prefix) layer_name = *prefix;
146 auto* plumbing = static_cast<Plumbing*>(
stack_[i]);
147 plumbing->EnumerateLayers(&layer_name, layers);
157 int index = strtol(
id, &next_id, 10);
158 if (index < 0 || index >=
stack_.size())
return nullptr;
160 auto* plumbing = static_cast<Plumbing*>(
stack_[index]);
162 return plumbing->GetLayer(next_id + 1);
170 int index = strtol(
id, &next_id, 10);
171 if (index < 0 || index >=
stack_.size())
return nullptr;
173 auto* plumbing = static_cast<Plumbing*>(
stack_[index]);
175 return plumbing->LayerLearningRatePtr(next_id + 1);
184 uint32_t size =
stack_.size();
187 for (uint32_t i = 0; i < size; ++i)
202 for (uint32_t i = 0; i < size; ++i) {
204 if (network ==
nullptr)
return false;
218 for (
int i = 0; i <
stack_.size(); ++i) {
226 stack_[i]->Update(learning_rate, momentum, adam_beta, num_samples);
235 double* changed)
const {
237 const auto* plumbing = static_cast<const Plumbing*>(&other);
239 for (
int i = 0; i <
stack_.size(); ++i)
bool IsPlumbingType() const override
void add_str_int(const char *str, int number)
GenericVector< float > learning_rates_
virtual void SetEnableTraining(TrainingState state)
virtual void AddToStack(Network *network)
void EnumerateLayers(const STRING *prefix, GenericVector< STRING > *layers) const
Plumbing(const STRING &name)
bool Serialize(FILE *fp) const
void CountAlternators(const Network &other, double *same, double *changed) const override
int RemapOutputs(int old_no, const std::vector< int > &code_map) override
void CacheXScaleFactor(int factor) override
PointerVector< Network > stack_
int InitWeights(float range, TRand *randomizer) override
void SetRandomizer(TRand *randomizer) override
void SetEnableTraining(TrainingState state) override
static Network * CreateFromFile(TFile *fp)
bool DeSerialize(char *data, size_t count=1)
bool DeSerialize(bool swap, FILE *fp)
bool Serialize(const char *data, size_t count=1)
void ConvertToInt() override
float * LayerLearningRatePtr(const char *id) const
Network * GetLayer(const char *id) const
virtual void SetNetworkFlags(uint32_t flags)
void Update(float learning_rate, float momentum, float adam_beta, int num_samples) override
bool SetupNeedsBackprop(bool needs_backprop) override
void DebugWeights() override
bool DeSerialize(TFile *fp) override
int XScaleFactor() const override
virtual bool Serialize(TFile *fp) const
void SetNetworkFlags(uint32_t flags) override
bool Serialize(TFile *fp) const override