machine learning - How does one keep track of the training error of a Neural Network when using Batch Normalization in TensorFlow? -


i wanted keep track of training error neural network trained. during testing, customary remove batch normalization layer. example:

# when test # is_training determines if batch-norm off or on error = sess.run([opt, loss], feed_dict={x: bx, y: by, is_training=false})     

however, want track training error of neural network number of iterations increases. simplicity assume data sets large enough train model , small enough computing error on entire data set feasible (i know possible use batches make computations more efficient or moving averages, besides point of question). in case correct way track training error turning off batch normalization follows:

bx, = x_train, y_train train_error = sess.run([opt, loss], feed_dict={x: bx, y: by, is_training=false})   

i.e. should use data trained turn off batch normalization?

notice if doing training is_training=true should invariable true. i.e. training step is:

bx, = get_batch(x_train, y_train) b_error = sess.run([opt, loss], feed_dict={x: bx, y: by, is_training=true})   

however confuses me if should report b_error or train_error. in other words, when want track training error, should batch normalization layer off or on? should on during training , off when pass in test set, when want report train error during training, should off?


notice obvious batch normalization layer should off when passing test or cross validation (cv) data

bx, = x_test, y_test # or x_cv, y_cv test_error = sess.run([opt, loss], feed_dict={x: bx, y: by, is_training=false})   

for reporting use same metric on both training , test set.

for example, while training might use dropout increase robustness of net. figure out how net performs out-of-sample, however, compare predictions on training set predictions on test set using nodes in net.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -