July 2018
Beginner to intermediate
406 pages
9h 55m
English
It is time to learn a little bit more about sessions. As we saw earlier, TensorFlow only executes the operations inside a session.
The simplest usage of a session is the following:
with tf.Session() as sess: sess.run(tf.global_variables_initializer()) sess.run([mean], feed_dict={})
This will initialize the variables by calling their initializer inside the session. In a neural network, we cannot have all variables starting with a zero value, especially the weights in the different layers (some, such as bias, can be initialized to 0). The initializer is then of prime importance and is either set directly for explicit variables, or is implicit when calling mid-level functions (see the different initializers available with TensorFlow ...
Read now
Unlock full access