This question came to me when I read the documentation of global_step. Here it explicitly declares global_step is not trainable.
global_step_tensor = tf.Variable(10, trainable=False, name='global_step')
sess = tf.Session()
print('global_step: %s' % tf.train.global_step(sess, global_step_tensor))
From my understanding, trainable means that the value could be changed during sess.run(). I have tried to declare it both trainable and non-trainable and got the same results. So I didn't understand why we need to declare it not trainable.
I read the documentation of trainable but didn't quite get it.
So my question is:
- Can non-trainable variable value be changed during sess.run() and vice versa?
- What is the point that make a variable not trainable?