tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
18 #ifndef TESSERACT_LSTM_WEIGHTMATRIX_H_
19 #define TESSERACT_LSTM_WEIGHTMATRIX_H_
41 for (
int i = 0; i < size1; ++i)
put(i, t, data[i]);
45 for (
int i = 0; i < size1; ++i)
put(i, t, data[i]);
49 int num_features =
dim1();
51 for (
int y = 0; y < num_features; ++y) {
52 for (
int t = 0; t < width; ++t) {
53 if (num == 0 || t < num || t + num >= width) {
103 const double*
GetWeights(
int index)
const {
return wf_[index]; }
105 double GetDW(
int i,
int j)
const {
return dw_(i, j); }
142 void Update(
double learning_rate,
double momentum,
double adam_beta,
150 double* changed)
const;
180 std::vector<int8_t> shaped_w_;
185 #endif // TESSERACT_LSTM_WEIGHTMATRIX_H_
void CountAlternators(const WeightMatrix &other, double *same, double *changed) const
~TransposedArray() override
void AddDeltas(const WeightMatrix &other)
void SumOuterTransposed(const TransposedArray &u, const TransposedArray &v, bool parallel)
void WriteStrided(int t, const float *data)
void Update(double learning_rate, double momentum, double adam_beta, int num_samples)
void PrintUnTransposed(int num)
void Debug2D(const char *msg)
void Transpose(const GENERIC_2D_ARRAY< double > &input)
int RoundInputs(int size) const
bool DeSerialize(bool training, TFile *fp)
bool Serialize(bool training, TFile *fp) const
static const IntSimdMatrix * intSimdMatrix
int RoundInputs(int size) const
bool DeSerializeOld(bool training, TFile *fp)
int InitWeightsFloat(int no, int ni, bool use_adam, float weight_range, TRand *randomizer)
int RemapOutputs(const std::vector< int > &code_map)
void WriteStrided(int t, const double *data)
void MatrixDotVector(const double *u, double *v) const
void MultiplyAccumulate(const double *v, double *inout)
const double * GetWeights(int index) const
void put(ICOORD pos, const double &thing)
void VectorDotMatrix(const double *u, double *v) const
DLLSYM void tprintf(const char *format,...)
double GetDW(int i, int j) const
static void FloatToDouble(const GENERIC_2D_ARRAY< float > &wf, GENERIC_2D_ARRAY< double > *wd)