32 "[1,32,0,1 Ct5,5,16 Mp4,4 Ct1,1,16 Ct3,3,128 Mp4,1 Ct1,1,64 S2,1 "
34 "no-lstm",
"eng/eng.unicharset",
"eng.Arial.exp0.lstmf",
false,
false, 2e-4,
false,
"eng");
37 LOG(
INFO) <<
"********** Expected < 98 ************\n";
40 SetupTrainerEng(
"[1,1,0,32 Lfx100 O1c1]",
"1D-lstm",
false,
false);
43 LOG(
INFO) <<
"********** Expected < 86 ************\n";
52 SetupTrainerEng(
"[1,32,0,3 S4,2 L2xy16 Ct1,1,16 S8,1 Lbx100 O1c1]",
"2D-color-lstm",
true,
true);
56 LOG(
INFO) <<
"********** Expected < 85 ************\n";
61 SetupTrainerEng(
"[1,1,0,32 Lbx100 O1c1]",
"bidi-lstm",
false,
false);
64 LOG(
INFO) <<
"********** Expected < 75 ************\n";
74 SetupTrainerEng(
"[1,32,0,1 S4,2 L2xy16 Ct1,1,16 S8,1 Lbx100 O1c1]",
"2-D-2-layer-lstm",
false,
79 LOG(
INFO) <<
"********** Expected < 98 ************\n";
89 SetupTrainerEng(
"[1,32,0,1 S4,2 L2xy16 Ct1,1,16 S8,1 Lbx100 O1c1]",
"2-D-2-layer-lstm",
false,
93 LOG(
INFO) <<
"********** Expected < 70 ************\n";
100 "[1,30,0,1 Ct5,5,16 Mp2,2 L2xy24 Ct1,1,48 Mp5,1 Ct1,1,32 S3,1 Lbx64 "
102 "2-D-2-layer-lstm",
false,
true);
104 LOG(
INFO) <<
"********** *** ************\n";
110 SetupTrainerEng(
"[1,32,0,1 S4,2 L2xy16 Ct1,1,16 S8,1 Lbx100 O1c1]",
"2-D-2-layer-lstm",
false,
113 double act_error_a = trainer_->ActivationError();
114 double char_error_a = trainer_->CharError();
115 std::vector<char> trainer_a_data;
117 SetupTrainerEng(
"[1,32,0,1 S4,2 L2xy16 Ct1,1,16 S8,1 Lbx100 O1c1]",
"2-D-2-layer-lstm",
false,
120 double act_error_b = trainer_->ActivationError();
121 double char_error_b = trainer_->CharError();
127 act_error_b = trainer_->ActivationError();
128 char_error_b = trainer_->CharError();
130 SetupTrainerEng(
"[1,32,0,1 S4,2 L2xy16 Ct1,1,16 S8,1 Lbx100 O1c1]",
"2-D-2-layer-lstm",
false,
132 EXPECT_TRUE(trainer_->ReadTrainingDump(trainer_a_data, *trainer_));
134 act_error_a = trainer_->ActivationError();
135 char_error_a = trainer_->CharError();
139 LOG(
INFO) <<
"********** *** ************\n";
145 SetupTrainerEng(
"[1,1,0,32 Lfx96 O1c1]",
"1D-lstm",
false,
true);
149 LOG(
INFO) <<
"********** Expected < 60 ************\n";
156 LOG(
INFO) <<
"Delta in Int mode error rates = " << delta <<
"\n";
165 SetupTrainerEng(
"[1,1,0,32 LS96]",
"Lstm-+-softmax",
false,
true);
168 LOG(
INFO) <<
"********** Expected < 49 ************\n";
177 SetupTrainerEng(
"[1,1,0,32 LE96]",
"Lstm-+-softmax",
false,
true);
180 LOG(
INFO) <<
"********** Expected < 62 ************\n";
188 SetupTrainerEng(
"[1,32,0,1 Ct5,5,16 Mp2,2 Lfys32 Lbx128 O1c1]",
"SQU-lstm",
false,
false);
190 const size_t kNumLayers = 8;
192 const char *kLayerIds[kNumLayers] = {
":0",
":1:0",
":1:1",
":2",
":3:0",
":4:0",
":4:1:0",
":5"};
193 const char *kLayerNames[kNumLayers] = {
"Input",
"Convolve",
"ConvNL",
"Maxpool",
194 "Lfys32",
"Lbx128LTR",
"Lbx128",
"Output"};
196 const int kNumWeights[kNumLayers] = {0,
200 32 * (4 * (32 + 16 + 1)),
201 128 * (4 * (128 + 32 + 1)),
202 128 * (4 * (128 + 32 + 1)),
203 112 * (2 * 128 + 1)};
205 auto layers = trainer_->EnumerateLayers();
207 for (
unsigned i = 0;
i < kNumLayers &&
i < layers.size(); ++
i) {
209 EXPECT_STREQ(kLayerNames[
i], trainer_->GetLayer(layers[
i])->name().c_str());
210 EXPECT_EQ(kNumWeights[
i], trainer_->GetLayer(layers[
i])->num_weights());
#define EXPECT_EQ(val1, val2)
#define EXPECT_FLOAT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
#define EXPECT_LT(val1, val2)
const int kTrainerIterations
TEST_F(EuroText, FastLatinOCR)