3 ms·
Another suggestion: 'operation' would be better named 'train_step' -- it's more descriptive and eliminates the need for the comment at the end. Also, it's bes
by dgacmu 10y ago
Another suggestion: 'operation' would be better named 'train_step' -- it's more descriptive and eliminates the need for the comment at the end.
Also, it's best practice and common tensorflow idiom to do:
init = tf.initialize_all_variables()
...
with tf.Session() as session:
session.run(init)
Not just for style, but because creating new graph nodes after creating the session requires tearing down and then re-setting-up some of the internal session stuff. It's much faster to move the initialize_all_variables() creation outside of the session.