Skip to content

Commit

Permalink
Remove deprecated Trainer::update_epoch
Browse files Browse the repository at this point in the history
It was deprecated in clab#695.
  • Loading branch information
tetsuok committed Sep 3, 2017
1 parent 87df341 commit 4569924
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/cpp/embed-cl/train_embed-cl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
random_shuffle(order.begin(), order.end());
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/encdec/train_encdec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int main(int argc, char** argv) {
// Run for the given number of epochs (or indefinitely if params.NUM_EPOCHS is negative)
while (epoch < params.NUM_EPOCHS || params.NUM_EPOCHS < 0) {
// Update the optimizer
if (first) { first = false; } else { adam->update_epoch(); }
if (first) { first = false; }
// Reshuffle the dataset
cerr << "**SHUFFLE\n";
random_shuffle(order.begin(), order.end());
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/imdb/train_imdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/mlc/train_mlc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == train.size()) {
si = 0;
if (first) { first = false; } else { sgd.update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/mnist/train_mnist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int main(int argc, char** argv) {
// Run for the given number of epochs (or indefinitely if params.NUM_EPOCHS is negative)
while (epoch < params.NUM_EPOCHS || params.NUM_EPOCHS < 0) {
// Update the optimizer
if (first) { first = false; } else { adam.update_epoch(); }
if (first) { first = false; }
// Reshuffle the dataset
cerr << "**SHUFFLE\n";
random_shuffle(order.begin(), order.end());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/rnnlm-aevb/train_rnnlm-aevb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/rnnlm-batch/train_rnnlm-batch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main(int argc, char** argv) {
// Run for the given number of epochs (or indefinitely if params.NUM_EPOCHS is negative)
while (epoch < params.NUM_EPOCHS || params.NUM_EPOCHS < 0) {
// Update the optimizer
if (first) { first = false; } else { adam->update_epoch(); }
if (first) { first = false; }
// Reshuffle the dataset
cerr << "**SHUFFLE\n";
random_shuffle(order.begin(), order.end());
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/rnnlm-cfsm/train_rnnlm-cfsm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/rnnlm-final-batch/train_rnnlm-final-batch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i, ++si) {
if (si == order.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/rnnlm-givenbag/rnnlm-givenbag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/rnnlm/train_rnnlm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
completed_epoch++;
if (eta_decay_onset_epoch && completed_epoch >= (int)eta_decay_onset_epoch)
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/segrnn-sup/train_segrnn-sup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/skiprnnlm/train_skiprnnlm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
LOG(INFO) << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/tag-bilstm/train_tag-bilstm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/textcat/train_textcat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/tok-embed/train_tok-embed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ int main(int argc, char** argv) {
for (unsigned i = 0; i < report_every_i; ++i) {
if (si == training.size()) {
si = 0;
if (first) { first = false; } else { sgd->update_epoch(); }
if (first) { first = false; }
cerr << "**SHUFFLE\n";
shuffle(order.begin(), order.end(), *rndeng);
}
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/xor-xent/train_xor-xent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ int main(int argc, char** argv) {
cg.backward(loss_expr);
sgd.update();
}
sgd.update_epoch();
loss /= 4;
cerr << "E = " << loss << endl;
}
Expand Down

0 comments on commit 4569924

Please sign in to comment.