Created
December 31, 2019 08:21
-
-
Save SuvroBaner/9f89d2ae31a5328e23daed2ea90fb282 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def linear_function(): | |
X = np.random.randn(4, 1) # Initializes X to be a random tensor of shape (4,1) | |
W = np.random.randn(5, 4) # Initializes W to be a random tensor of shape (5,4) | |
b = np.random.randn(5, 1) # Initializes b to be a random tensor of shape (5,1) | |
Y = tf.add(tf.matmul(W, X), b) # computation graph | |
sess = tf.Session() | |
result = sess.run(Y) # evaluating the computation graph | |
sess.close() # closing the tf session | |
return result | |
print(linear_function()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment