Skip to content

Instantly share code, notes, and snippets.

@pannous
pannous / tensorflow_xor_hello_world.py
Created November 11, 2015 14:33
A simple neural network learning the XOR function with the tensorflow framework
#!/usr/bin/env PYTHONIOENCODING="utf-8" python
"""
A simple neural network learning the XOR function
"""
import tensorflow as tf
sess = tf.InteractiveSession()
# Desired input output mapping of XOR function:
x_ = [[0, 0], [0, 1], [1, 0], [1, 1]] # input
#labels=[0, 1, 1, 0] # output =>