Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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]) |
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
# Computes softmax cross entropy between logits and labels | |
# Measures the probability error in discrete classification tasks | |
# For example, each font image is labeled with one and only one label: an image can be font SansSerif or Serif, but not both. | |
cross_entropy = tf.reduce_mean( | |
tf.nn.softmax_cross_entropy_with_logits_v2( | |
logits = y + 1e-50, labels = y_)) | |
# GradientDescentOptimizer is used to minimize loss | |
train_step = tf.train.GradientDescentOptimizer( | |
0.02).minimize(cross_entropy) |
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 | |
# 36*36 pixels, image with one channel graysacle | |
x = tf.placeholder("float", [None, 36, 36]) | |
# -1 is for reshaping which means to fill out the dimensions as needed to maintain the overall size | |
# 36,36 is image dimension | |
# the final 1, is now the number of channel | |
# we have grayscale image that the number of channel is 1 |
OlderNewer