Please enable JavaScript.
Coggle requires JavaScript to display documents.
TENSORS_103 (VARIABLE (Collections (tf.GraphKeys.GLOBAL_VARIABLES, tf…
TENSORS_103
VARIABLE
Intro
-
Unlike other Tensors, VARIABLE exists outside the context of a single session.run()
-
-
Creating
tf.get_variable(name, shape, initializer, dtype, trainable, collections= tf.GraphKeys.GLOBAL_VARIABLES)
Collections
-
-
-
when initializing a variable in LOCAL_VARIABLE collections, it is NOT TRAINABLE
-
tf.add_to_collection("my_collection_name", my_local_var)---- add local var to your own collections -- no need to initialize collection
-
-
STEPS
above init for all GLOBAL, TRAINABLE variables
-
-
v = tf.get_variable("v", shape=(), initializer=tf.zeros_initializer())
w = tf.get_variable("w", initializer=v.initialized_value() + 1) ------ for dependency in initialization
-
-
-
-