Created
March 11, 2020 20:52
-
-
Save sol0invictus/03203007199cac49fb95ce2f486bf9be 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
y_hat = tf.constant(36, name='y_hat') # Define y_hat constant. Set to 36. | |
y = tf.constant(39, name='y') # Define y. Set to 39 | |
loss = tf.Variable((y - y_hat)**2, name='loss') # Create a variable for the loss | |
init = tf.global_variables_initializer() # When init is run later (session.run(init)), | |
# the loss variable will be initialized and ready to be computed | |
with tf.Session() as session: # Create a session and print the output | |
session.run(init) # Initializes the variables | |
print(session.run(loss)) # Prints the loss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment