src/lstm/fullyconnected.cpp
void FullyConnected::SetEnableTraining(TrainingState state) {
  if (state == TS_RE_ENABLE) {
    // Enable only from temp disabled.
    if (training_ == TS_TEMP_DISABLE) {
      training_ = TS_ENABLED;
    }
  } else if (state == TS_TEMP_DISABLE) {
    // Temp disable only from enabled.
    if (training_ == TS_ENABLED) {
      training_ = state;
    }
  } else {
    if (state == TS_ENABLED && training_ != TS_ENABLED) {
      weights_.InitBackward();
    }
    training_ = state;
  }
}
// Suspends/Enables training by setting the training_ flag.
Suspends/Enables training by setting the training_ flag.
Suspends / Enables training by setting the training_ flag .
void FullyConnected::SetEnableTraining(TrainingState state) {
  if (state == TS_RE_ENABLE) {
    if (training_ == TS_TEMP_DISABLE) {
      training_ = TS_ENABLED;
    }
  } else if (state == TS_TEMP_DISABLE) {
    if (training_ == TS_ENABLED) {
      training_ = state;
    }
  } else {
    if (state == TS_ENABLED && training_ != TS_ENABLED) {
      weights_.InitBackward();
    }
    training_ = state;
  }
}
void FullyConnected :: SetEnableTraining ( TrainingState state ) { if ( state == TS_RE_ENABLE ) { if ( training_ == TS_TEMP_DISABLE ) { training_ = TS_ENABLED ; } } else if ( state == TS_TEMP_DISABLE ) { if ( training_ == TS_ENABLED ) { training_ = state ; } } else { if ( state == TS_ENABLED && training_ != TS_ENABLED ) { weights_ . InitBackward ( ) ; } training_ = state ; } }
Suspends/Enables training by setting the training_ flag.
Suspends / Enables training by setting the training_ flag .
// Enable only from temp disabled. // Temp disable only from enabled.