From 3793e29e0e1eb4201a12115456eec69a61fb9554 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 22 Jan 2017 10:25:29 -0500 Subject: [PATCH] Added comments about test_one_step() --- examples/dnn_introduction2_ex.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/dnn_introduction2_ex.cpp b/examples/dnn_introduction2_ex.cpp index f56634873..579b8c678 100644 --- a/examples/dnn_introduction2_ex.cpp +++ b/examples/dnn_introduction2_ex.cpp @@ -303,7 +303,16 @@ int main(int argc, char** argv) try mini_batch_labels.push_back(training_labels[idx]); } + // Tell the trainer to update the network given this mini-batch trainer.train_one_step(mini_batch_samples, mini_batch_labels); + + // You can also feed validation data into the trainer by periodically + // calling trainer.test_one_step(samples,labels). Unlike train_one_step(), + // test_one_step() doesn't modify the network, it only computes the testing + // error which it records internally. This testing error will then be print + // in the verbose logging and will also determine when the trainer's + // automatic learning rate shrinking happens. Therefore, test_one_step() + // can be used to perform automatic early stopping based on held out data. } // When you call train_one_step(), the trainer will do its processing in a