19 #ifndef TESSERACT_LSTM_LSTM_H_ 20 #define TESSERACT_LSTM_LSTM_H_ 50 LSTM(
const STRING&
name,
int num_inputs,
int num_states,
int num_outputs,
68 if (softmax_ != NULL) spec += softmax_->
spec();
81 int RemapOutputs(
int old_no,
const std::vector<int>& code_map)
override;
107 void Update(
float learning_rate,
float momentum,
float adam_beta,
108 int num_samples)
override;
113 double* changed)
const;
126 void ResizeForward(
const NetworkIO& input);
163 #endif // TESSERACT_LSTM_LSTM_H_
virtual int InitWeights(float range, TRand *randomizer)
virtual void ConvertToInt()
virtual void CountAlternators(const Network &other, double *same, double *changed) const
virtual StaticShape OutputShape(const StaticShape &input_shape) const
void add_str_int(const char *str, int number)
virtual bool Serialize(TFile *fp) const
LSTM(const STRING &name, int num_inputs, int num_states, int num_outputs, bool two_dimensional, NetworkType type)
virtual void SetEnableTraining(TrainingState state)
virtual bool DeSerialize(TFile *fp)
const STRING & name() const
int RemapOutputs(int old_no, const std::vector< int > &code_map) override
virtual void DebugWeights()
void Update(float learning_rate, float momentum, float adam_beta, int num_samples) override
virtual void Forward(bool debug, const NetworkIO &input, const TransposedArray *input_transpose, NetworkScratch *scratch, NetworkIO *output)
virtual STRING spec() const
virtual STRING spec() const
virtual bool Backward(bool debug, const NetworkIO &fwd_deltas, NetworkScratch *scratch, NetworkIO *back_deltas)