Last active
August 7, 2018 00:57
-
-
Save joeyism/ee5b36a17934d2242084d257a704bd6d to your computer and use it in GitHub Desktop.
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
| from cifar import Cifar | |
| import tensorflow as tf | |
| import model | |
| learning_rate = 0.001 | |
| y = tf.placeholder(tf.float32, [None, model.n_classes]) | |
| cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits( | |
| logits=model.out, | |
| labels=y)) | |
| optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost) | |
| correct_pred = tf.equal(tf.argmax(model.out, 1), tf.argmax(y, 1)) | |
| accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment