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;
157 int index = strtol(
id, &next_id, 10);
158 if (index < 0 || index >=
stack_.size())
return nullptr;
162 return plumbing->
GetLayer(next_id + 1);
170 int index = strtol(
id, &next_id, 10);
171 if (index < 0 || index >=
stack_.size())
return nullptr;
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 {
239 for (
int i = 0; i <
stack_.size(); ++i)
void ConvertToInt() override
void SetRandomizer(TRand *randomizer) override
static Network * CreateFromFile(TFile *fp)
Plumbing(const STRING &name)
GenericVector< float > learning_rates_
int RemapOutputs(int old_no, const std::vector< int > &code_map) override
void CacheXScaleFactor(int factor) override
int InitWeights(float range, TRand *randomizer) override
bool DeSerialize(char *data, size_t count=1)
float * LayerLearningRatePtr(const char *id) const
bool DeSerialize(bool swap, FILE *fp)
bool Serialize(FILE *fp) const
PointerVector< Network > stack_
virtual void AddToStack(Network *network)
virtual void SetEnableTraining(TrainingState state)
virtual bool Serialize(TFile *fp) const
bool IsPlumbingType() const override
Network * GetLayer(const char *id) const
bool Serialize(TFile *fp) const override
int XScaleFactor() const override
void SetEnableTraining(TrainingState state) override
void DebugWeights() override
bool Serialize(const char *data, size_t count=1)
void CountAlternators(const Network &other, double *same, double *changed) const override
bool SetupNeedsBackprop(bool needs_backprop) override
void add_str_int(const char *str, int number)
void Update(float learning_rate, float momentum, float adam_beta, int num_samples) override
virtual void SetNetworkFlags(uint32_t flags)
bool DeSerialize(TFile *fp) override
void EnumerateLayers(const STRING *prefix, GenericVector< STRING > *layers) const
void SetNetworkFlags(uint32_t flags) override