December 2017
Intermediate to advanced
536 pages
14h 23m
English
We proceed with the recipe as follows:
import tensorflow as tf#Start an Interactive Sessionsess = tf.InteractiveSession()#Define a 5x5 Identity matrixI_matrix = tf.eye(5)print(I_matrix.eval()) # This will print a 5x5 Identity matrix#Define a Variable initialized to a 10x10 identity matrixX = tf.Variable(tf.eye(10))X.initializer.run() # Initialize the Variableprint(X.eval()) # Evaluate the Variable and print the result#Create a random 5x10 matrixA = tf.Variable(tf.random_normal([5,10]))A.initializer.run()#Multiply two matricesproduct = tf.matmul(A, X)print(product.eval())#create a random matrix of 1s and 0s, size 5x10b = tf.Variable(tf.random_uniform([5,10], ...
Read now
Unlock full access