Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Create an interactive Tensorflow session
sess = tf.InteractiveSession()
# These will be inputs for the model
# Input pixels of images, flattened
# 1296 = 36*36 which is the size of images
x = tf.placeholder("float", [None, 1296])
# Known labels
y_ = tf.placeholder("float", [None,2])
# Variables
# W is for weights
# b is for bias
# these 2 variables will be updated during the training
W = tf.Variable(tf.zeros([1296,2]))
b = tf.Variable(tf.zeros([2]))
# Initialize variables
sess.run(tf.global_variables_initializer())
# Define our logistic regression model
y = tf.nn.softmax(tf.matmul(x,W) + b)
# Finish model specification, let us start training the model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.