src/lstm/network.cpp
void Network::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 {
    training_ = state;
  }
}
// Suspends/Enables/Permanently disables training by setting the training_
// flag. Serialize and DeSerialize only operate on the run-time data if state
// is TS_DISABLED or TS_TEMP_DISABLE. Specifying TS_TEMP_DISABLE will
// temporarily disable layers in state TS_ENABLED, allowing a trainer to
// serialize as if it were a recognizer.
// TS_RE_ENABLE will re-enable layers that were previously in any disabled
// state. If in TS_TEMP_DISABLE then the flag is just changed, but if in
// TS_DISABLED, the deltas in the weight matrices are reinitialized so that a
// recognizer can be converted back to a trainer.
Suspends/Enables/Permanently disables training by setting the training_
flag. Serialize and DeSerialize only operate on the run-time data if state
is TS_DISABLED or TS_TEMP_DISABLE. Specifying TS_TEMP_DISABLE will
temporarily disable layers in state TS_ENABLED, allowing a trainer to
serialize as if it were a recognizer.
TS_RE_ENABLE will re-enable layers that were previously in any disabled
state. If in TS_TEMP_DISABLE then the flag is just changed, but if in
TS_DISABLED, the deltas in the weight matrices are reinitialized so that a
recognizer can be converted back to a trainer.
Suspends / Enables / Permanently disables training by setting the training_ flag . Serialize and DeSerialize only operate on the run - time data if state is TS_DISABLED or TS_TEMP_DISABLE . Specifying TS_TEMP_DISABLE will temporarily disable layers in state TS_ENABLED allowing a trainer to serialize as if it were a recognizer . TS_RE_ENABLE will re - enable layers that were previously in any disabled state . If in TS_TEMP_DISABLE then the flag is just changed but if in TS_DISABLED the deltas in the weight matrices are reinitialized so that a recognizer can be converted back to a trainer .
void Network::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 {
    training_ = state;
  }
}
void Network :: 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 { training_ = state ; } }
Suspends/Enables/Permanently disables training by setting the training_
flag.
Suspends / Enables / Permanently disables training by setting the training_ flag .
// Enable only from temp disabled. // Temp disable only from enabled.