Skip to content

Commit

Permalink
Better fix for re-enabling training
Browse files Browse the repository at this point in the history
  • Loading branch information
theraysmith committed May 8, 2017
1 parent 0afd593 commit b86b4fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lstm/fullyconnected.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lstm/lstm.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit b86b4fa

Please sign in to comment.