Created
March 22, 2019 21:04
-
-
Save alinazhanguwo/b6d147339757a43510ed2a605720edba 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
# 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