mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Better fix for re-enabling training
This commit is contained in:
parent
0afd5939b1
commit
b86b4fa06b
@ -65,7 +65,7 @@ void FullyConnected::SetEnableTraining(TrainingState state) {
|
||||
// Temp disable only from enabled.
|
||||
if (training_ == TS_ENABLED) training_ = state;
|
||||
} else {
|
||||
if (state == TS_ENABLED && training_ == TS_DISABLED)
|
||||
if (state == TS_ENABLED && training_ != TS_ENABLED)
|
||||
weights_.InitBackward();
|
||||
training_ = state;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ void LSTM::SetEnableTraining(TrainingState state) {
|
||||
// Temp disable only from enabled.
|
||||
if (training_ == TS_ENABLED) training_ = state;
|
||||
} else {
|
||||
if (state == TS_ENABLED && training_ == TS_DISABLED) {
|
||||
if (state == TS_ENABLED && training_ != TS_ENABLED) {
|
||||
for (int w = 0; w < WT_COUNT; ++w) {
|
||||
if (w == GFS && !Is2D()) continue;
|
||||
gate_weights_[w].InitBackward();
|
||||
|
Loading…
Reference in New Issue
Block a user