19 #ifndef TESSERACT_LSTM_INPUT_H_ 20 #define TESSERACT_LSTM_INPUT_H_ 32 virtual ~Input() =
default;
84 const Network* network,
int min_width,
85 TRand* randomizer,
float* image_scale);
104 #endif // TESSERACT_LSTM_INPUT_H_ bool Serialize(TFile *fp) const override
Input(const STRING &name, int ni, int no)
STRING spec() const override
void Forward(bool debug, const NetworkIO &input, const TransposedArray *input_transpose, NetworkScratch *scratch, NetworkIO *output) override
StaticShape InputShape() const override
StaticShape OutputShape(const StaticShape &input_shape) const override
void CacheXScaleFactor(int factor) override
const STRING & name() const
bool Backward(bool debug, const NetworkIO &fwd_deltas, NetworkScratch *scratch, NetworkIO *back_deltas) override
int XScaleFactor() const override
void add_str_int(const char *str, int number)
static void PreparePixInput(const StaticShape &shape, const Pix *pix, TRand *randomizer, NetworkIO *input)
bool DeSerialize(TFile *fp) override
static Pix * PrepareLSTMInputs(const ImageData &image_data, const Network *network, int min_width, TRand *randomizer, float *image_scale)