Created
October 24, 2019 13:13
-
-
Save jvmncs/5e5f0627c580386561d6de45d31c26c2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
x = tf.expand_dims(id[0], 0) | |
# Initialize the weight | |
w_init = tf.initializers.glorot_normal() | |
w = tf.Variable(w_init(shape=(2, 1), dtype=tf.float32)).send(alice) | |
z = tf.matmul(x, w) | |
# Manual differentiation & update | |
dzdx = tf.transpose(x) | |
w.assign_sub(dzdx) | |
print("Updated: ", w.get()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment