mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-14 00:31:47 +08:00
2b7df59187
They were provided by Jeff Breidenbach <jbreiden@google.com>. Signed-off-by: Stefan Weil <sw@weilnetz.de>
21 lines
709 B
C++
21 lines
709 B
C++
|
|
#include "tesseract/unittest/lstm_test.h"
|
|
|
|
namespace tesseract {
|
|
|
|
// Tests that a Squashed network learns correctly.
|
|
// Almost as fast as the 2d-lstm.
|
|
TEST_F(LSTMTrainerTest, TestSquashed) {
|
|
// A 2-layer LSTM with a Squashed feature-extracting LSTM on the bottom, and
|
|
// a small convolution/maxpool below that.
|
|
// Match training conditions to those typically used with this spec:
|
|
// recoding on, adam on.
|
|
SetupTrainerEng("[1,32,0,1 Ct3,3,16 Mp3,3 Lfys48 Lbx96 O1c1]",
|
|
"SQU-2-layer-lstm", /*recode*/ true, /*adam*/ true);
|
|
double lstm_2d_err = TrainIterations(kTrainerIterations * 2);
|
|
EXPECT_LT(lstm_2d_err, 80);
|
|
TestIntMode(kTrainerIterations);
|
|
}
|
|
|
|
} // namespace tesseract.
|