Support for update ops such as weight decay.
@@ -88,6 +88,7 @@ def model_train(sess, loss, x, y, X_train, Y_train, save=False, init_all=True,
# Define optimizer
loss_value = loss.fprop(x, y, **fprop_args)
train_step = tf.train.AdamOptimizer(learning_rate=args.learning_rate)
+ with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
train_step = train_step.minimize(loss_value, var_list=var_list)
with sess.as_default():
