Last active
March 11, 2017 16:42
-
-
Save RahulBhalley/34eb85aa595835bf33ae4d7ff5ba7676 to your computer and use it in GitHub Desktop.
XOR gate solution to my post @ https://rahulbhalley.github.io/posts/2017-02/neural-networks-explained.html
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
# 2nd feedforward propagation | |
a_XW_c_w = tf.matmul(a_XW_c, w) | |
a_XW_c_w_b = tf.add(a_XW_c_w, b) | |
init = tf.global_variables_initializer() | |
# Launch the TensorFlow graph session | |
with tf.Session() as sess: | |
# initialize all the variables | |
sess.run(init) | |
outputs = feedforward() | |
print('XOR Inputs:') | |
for i in range(4): | |
print(sess.run(X[i])) | |
print('XOR Outputs:') | |
for i in range(4): | |
print(sess.run(outputs[i])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment