In [65]:
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle

In [66]:
pickle_file = '/Users/rringham/Projects/TensorFlow/tensorflow/tensorflow/examples/udacity/notMNIST.pickle'

with open(pickle_file, 'rb') as f:
  save = pickle.load(f)
  train_dataset = save['train_dataset']
  train_labels = save['train_labels']
  valid_dataset = save['valid_dataset']
  valid_labels = save['valid_labels']
  test_dataset = save['test_dataset']
  test_labels = save['test_labels']
  del save  # hint to help gc free up memory
  print('Training set', train_dataset.shape, train_labels.shape)
  print('Validation set', valid_dataset.shape, valid_labels.shape)
  print('Test set', test_dataset.shape, test_labels.shape)


Training set (200000, 28, 28) (200000,)
Validation set (10000, 28, 28) (10000,)
Test set (10000, 28, 28) (10000,)

In [67]:
image_size = 28
num_labels = 10
num_uns_labels = 50

def reformat(dataset, labels):
  dataset = dataset.reshape((-1, image_size * image_size)).astype(np.float32)
  # Map 2 to [0.0, 1.0, 0.0 ...], 3 to [0.0, 0.0, 1.0 ...]
  labels = (np.arange(num_uns_labels) == labels[:,None]).astype(np.float32)
  return dataset, labels
train_dataset, train_labels = reformat(train_dataset, train_labels)
valid_dataset, valid_labels = reformat(valid_dataset, valid_labels)
test_dataset, test_labels = reformat(test_dataset, test_labels)
print('Training set', train_dataset.shape, train_labels.shape)
print('Validation set', valid_dataset.shape, valid_labels.shape)
print('Test set', test_dataset.shape, test_labels.shape)


Training set (200000, 784) (200000, 50)
Validation set (10000, 784) (10000, 50)
Test set (10000, 784) (10000, 50)

In [68]:
def accuracy(predictions, labels):
  return (100.0 * np.sum(np.argmax(predictions, 1) == np.argmax(labels, 1))
          / predictions.shape[0])

Notes

With two hidden layers, the best accuracy I've been able to get on the test set below is roughly 90%:

  • h1: 1024 neurons
  • h2: 1024 neurons
  • h3: 305 neurons
  • h4: 75 neurons
  • Each set of weights initialized with stddev=sqrt(2/n), where n = # of neurons in previous layer
  • No dropout



In [69]:
import math as math

batch_size = 1
initial_learning_rate_value = 0.5
beta = 0.01

graph = tf.Graph()
with graph.as_default():

  # Input data. For the training data, we use a placeholder that will be fed
  # at run time with a training minibatch.
  tf_train_dataset = tf.placeholder(tf.float32, shape=(batch_size, image_size * image_size))
  tf_train_labels = tf.placeholder(tf.float32, shape=(batch_size, num_uns_labels))
  tf_valid_dataset = tf.constant(valid_dataset)
  tf_test_dataset = tf.constant(test_dataset)    
    
  # learning rate decay
  global_step = tf.Variable(0)
  learning_rate = tf.train.exponential_decay(initial_learning_rate_value, global_step, 1, 0.9999)

  # Variables
  h1_size = 1024  
  h2_size = 75
    
  weights_h1 = tf.Variable(tf.truncated_normal([image_size * image_size, h1_size], stddev=math.sqrt(2.0/(image_size*image_size))))
  biases_h1 = tf.Variable(tf.zeros([h1_size]))

  weights_h2 = tf.Variable(tf.truncated_normal([h1_size, h2_size], stddev=math.sqrt(2.0/h1_size)))
  biases_h2 = tf.Variable(tf.zeros([h2_size]))
    
  weights_o = tf.Variable(tf.truncated_normal([h2_size, num_uns_labels], stddev=math.sqrt(2.0/h2_size)))
  biases_o = tf.Variable(tf.zeros([num_uns_labels]))  

  # Model.
  def model(data):
    h1 = tf.nn.relu(tf.matmul(data, weights_h1) + biases_h1)
    h2 = tf.nn.relu(tf.matmul(h1, weights_h2) + biases_h2)
    return tf.matmul(h2, weights_o) + biases_o
    
  # Training computation.
  logits = model(tf_train_dataset)
  loss = tf.reduce_mean(
    tf.nn.softmax_cross_entropy_with_logits(logits, tf_train_labels)) + ((beta * tf.nn.l2_loss(weights_h1)) + (beta * tf.nn.l2_loss(weights_h2)) + (beta * tf.nn.l2_loss(weights_o)))
  
  # Optimizer.
  optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(loss, global_step=global_step)

  # Predictions for the training, validation, and test data.  
  train_prediction = tf.nn.softmax(model(tf_train_dataset))  
  valid_prediction = tf.nn.softmax(model(tf_valid_dataset))
  test_prediction = tf.nn.softmax(model(tf_test_dataset))

In [105]:
num_steps = 10
num_tsteps = 1
labels_used = 0

with tf.Session(graph=graph) as session:
  tf.initialize_all_variables().run()
  print("Initialized")
  for step in range(num_steps):
    # Pick an offset within the training data, which has been randomized.
    # Note: we could use better randomization across epochs.
    offset = (step * batch_size) % (train_labels.shape[0] - batch_size)
    
    # Generate training data component of minibatch
    batch_data = train_dataset[offset:(offset + batch_size), :]
    actual_labels = train_labels[offset:(offset + batch_size), :]
    print(actual_labels)
    
    # Assign label
    current_label = 0
    if labels_used == 0:
      print("Initializing offset: %d with current label of: %d" % (offset, current_label))
      labels_used += 1
      current_label = 0
    else:
      print("Determining label for offset: %d" % (offset))
      label_pred = session.run([train_prediction], feed_dict={tf_train_dataset : batch_data})
      print(label_pred)
      print(np.argmax(label_pred))
      current_label = np.argmax(label_pred)
    
    # Generate label data component of minibatch
    current_labels = np.array([current_label])
    current_labels_1h = (np.arange(num_uns_labels) == current_labels[:,None]).astype(np.float32)    
    batch_labels = current_labels_1h
    
    # Prepare a dictionary telling the session where to feed the minibatch.
    # The key of the dictionary is the placeholder node of the graph to be fed,
    # and the value is the numpy array to feed to it.
    feed_dict = {tf_train_dataset : batch_data, tf_train_labels : batch_labels}
    
    for tstep in range(num_tsteps):
      _, l, predictions = session.run(
        [optimizer, loss, train_prediction], feed_dict=feed_dict)
          
      print("    Minibatch loss at step %d, tstep: %d: %f," % (step, tstep, l))
      print("    Learning rate at step %d, tstep: %d: %f" % (step, tstep, learning_rate.eval()))
      print("    Minibatch accuracy: %.1f%%" % accuracy(predictions, batch_labels))
      print("    Validation accuracy: %.1f%%\n" % accuracy(valid_prediction.eval(), valid_labels))


#   for step in range(num_steps):
#     # Pick an offset within the training data, which has been randomized.
#     # Note: we could use better randomization across epochs.
#     offset = (step * batch_size) % (train_labels.shape[0] - batch_size)
    
#     # Generate a minibatch.
#     batch_data = train_dataset[offset:(offset + batch_size), :]
#     batch_labels = train_labels[offset:(offset + batch_size), :]
    
#     # Prepare a dictionary telling the session where to feed the minibatch.
#     # The key of the dictionary is the placeholder node of the graph to be fed,
#     # and the value is the numpy array to feed to it.
#     feed_dict = {tf_train_dataset : batch_data, tf_train_labels : batch_labels}
    
#     _, l, predictions = session.run(
#       [optimizer, loss, train_prediction], feed_dict=feed_dict)
    
#     if (step % 500 == 0):
#       print("Minibatch loss at step %d: %f" % (step, l))
#       print("Learning rate at step %d: %f" % (step, learning_rate.eval()))
#       print("Minibatch accuracy: %.1f%%" % accuracy(predictions, batch_labels))
#       print("Validation accuracy: %.1f%%\n" % accuracy(
#         valid_prediction.eval(), valid_labels))
        
#     if (step % 2000 == 0):
#       print("Test accuracy: %.1f%%\n" % accuracy(test_prediction.eval(), test_labels))
        
  print("Final test accuracy: %.1f%%\n" % accuracy(test_prediction.eval(), test_labels))


Initialized
[[ 0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Initializing offset: 0 with current label of: 0
    Minibatch loss at step 0, tstep: 0: 12.840612,
    Learning rate at step 0, tstep: 0: 0.499950
    Minibatch accuracy: 0.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 1
[array([[  9.99999881e-01,   2.24249078e-10,   2.47857151e-11,
          1.94666629e-08,   8.71971453e-11,   1.35435940e-09,
          1.45522171e-11,   8.36734571e-10,   1.10039777e-09,
          2.40754687e-08,   3.25361071e-08,   7.68593869e-11,
          1.64139013e-09,   1.73332615e-09,   9.90594606e-10,
          1.32575939e-09,   4.77505979e-10,   1.03401537e-10,
          2.08048849e-08,   1.76514359e-10,   2.06263207e-09,
          2.54341836e-09,   1.97615946e-09,   1.13127085e-09,
          3.36616394e-11,   5.89384008e-09,   4.22857277e-10,
          4.48085613e-09,   2.27195263e-09,   1.09715981e-09,
          8.56717267e-11,   8.09678768e-10,   3.12280896e-11,
          2.56878474e-09,   5.24849997e-10,   1.85309745e-09,
          4.94423241e-13,   9.05925945e-10,   7.78072190e-11,
          1.44045045e-11,   4.25545537e-08,   9.77852963e-08,
          9.24227805e-09,   9.73482905e-13,   1.86692284e-09,
          2.04742108e-08,   8.78542239e-11,   6.66796451e-10,
          3.84196923e-08,   3.14149762e-10]], dtype=float32)]
0
    Minibatch loss at step 1, tstep: 0: 9.007955,
    Learning rate at step 1, tstep: 0: 0.499900
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 2
[array([[  1.00000000e+00,   2.43372471e-16,   2.74164651e-18,
          1.57425193e-13,   4.17097221e-17,   9.03159891e-15,
          4.19519289e-18,   1.07569966e-15,   2.87828254e-15,
          3.59883483e-13,   8.21415473e-13,   2.54055737e-17,
          1.25550654e-15,   4.81156303e-15,   2.31021672e-15,
          6.11309014e-15,   9.08938350e-16,   6.68309260e-17,
          2.16761057e-13,   9.19936279e-17,   4.14629235e-15,
          8.05155300e-15,   6.51283930e-15,   2.20477742e-15,
          5.54648134e-18,   5.26731368e-14,   4.98134994e-16,
          1.16989971e-14,   6.30824738e-15,   1.99535615e-15,
          4.87617446e-17,   1.51129620e-15,   1.54887601e-17,
          1.73045799e-14,   1.75120261e-15,   3.75367309e-15,
          5.19972680e-21,   3.27142759e-15,   4.26314594e-17,
          1.17236794e-18,   2.99813126e-13,   4.37764365e-12,
          1.20906933e-13,   7.00661318e-21,   4.27841551e-15,
          2.00171653e-13,   6.17686733e-17,   1.09279786e-15,
          5.83197824e-13,   1.54485244e-16]], dtype=float32)]
0
    Minibatch loss at step 2, tstep: 0: 8.918080,
    Learning rate at step 2, tstep: 0: 0.499850
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 3
[array([[  1.00000000e+00,   1.32743282e-19,   1.18219680e-21,
          3.87554472e-16,   1.94803619e-20,   1.26309528e-17,
          1.47771363e-21,   1.10237171e-18,   1.88382981e-18,
          9.13962420e-16,   5.07696641e-15,   1.22483461e-20,
          1.85691046e-18,   9.59136021e-18,   3.02706042e-18,
          6.76292529e-18,   1.37982287e-18,   4.03018195e-20,
          6.65513681e-16,   6.26265163e-20,   8.59783688e-18,
          2.52724721e-17,   6.55565203e-18,   3.90988754e-18,
          1.53551258e-21,   1.19098113e-16,   4.49916925e-19,
          2.55822777e-17,   8.98649514e-18,   2.32899857e-18,
          4.01554182e-20,   3.33230806e-18,   5.09866859e-21,
          2.53122231e-17,   3.23324760e-18,   4.82355650e-18,
          6.28801028e-25,   5.55908468e-18,   3.33344901e-20,
          2.53662882e-22,   1.97665874e-15,   2.53132273e-14,
          4.71954106e-16,   5.80916185e-25,   6.37393534e-18,
          6.53535894e-16,   4.13569821e-20,   1.50417345e-18,
          2.69837317e-15,   1.38431403e-19]], dtype=float32)]
0
    Minibatch loss at step 3, tstep: 0: 8.829213,
    Learning rate at step 3, tstep: 0: 0.499800
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 4
[array([[  1.00000000e+00,   1.26131451e-12,   8.59526344e-14,
          1.93137173e-10,   5.06023663e-13,   2.43877731e-11,
          9.19772816e-14,   4.64332392e-12,   1.40978245e-11,
          5.14709331e-10,   6.65306310e-10,   3.17818444e-13,
          1.02853108e-11,   1.66085097e-11,   7.79164927e-12,
          1.53791216e-11,   6.18388500e-12,   9.31890632e-13,
          5.17253407e-10,   8.22672984e-13,   1.80994456e-11,
          4.14614246e-11,   2.40539533e-11,   1.14436689e-11,
          1.25667692e-13,   1.04324709e-10,   4.57676258e-12,
          5.28035844e-11,   2.32055104e-11,   1.21168848e-11,
          7.52659816e-13,   7.73360976e-12,   1.23202975e-13,
          2.87349415e-11,   7.30448688e-12,   2.46786376e-11,
          4.69012519e-16,   1.22657492e-11,   5.76326421e-13,
          3.93719549e-14,   8.06886891e-10,   3.17603366e-09,
          2.05413145e-10,   1.22488450e-15,   1.98376732e-11,
          3.13098159e-10,   5.35322492e-13,   7.39122392e-12,
          7.95833177e-10,   1.53921732e-12]], dtype=float32)]
0
    Minibatch loss at step 4, tstep: 0: 8.741118,
    Learning rate at step 4, tstep: 0: 0.499750
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 5
[array([[  9.99635458e-01,   1.16673095e-06,   5.72625027e-07,
          1.08653794e-05,   6.12347037e-07,   4.21438926e-06,
          3.86307420e-07,   1.49135826e-06,   1.84899216e-06,
          8.70613258e-06,   5.80603446e-05,   7.62754382e-07,
          3.26114969e-06,   5.87521663e-06,   6.37616768e-06,
          5.56434679e-06,   2.69553516e-06,   1.22283791e-06,
          1.85853423e-05,   1.34208233e-06,   3.69663894e-06,
          7.80513255e-06,   3.51352878e-06,   3.14150338e-06,
          6.75875071e-07,   7.52304186e-06,   2.34086292e-06,
          9.41853978e-06,   4.65962148e-06,   2.09086716e-06,
          8.58067210e-07,   5.34437140e-06,   6.87566910e-07,
          5.95849633e-06,   4.74898297e-06,   3.69816598e-06,
          3.88192909e-08,   2.11622387e-06,   1.08989457e-06,
          2.45405829e-07,   2.53923972e-05,   7.08762454e-05,
          1.75504465e-05,   2.51271359e-08,   6.74166949e-06,
          1.40854454e-05,   1.41176474e-06,   2.51758775e-06,
          2.11952320e-05,   1.49787650e-06]], dtype=float32)]
0
    Minibatch loss at step 5, tstep: 0: 8.654333,
    Learning rate at step 5, tstep: 0: 0.499700
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 6
[array([[  1.00000000e+00,   1.18444903e-14,   3.61283216e-16,
          7.59511638e-12,   2.10190400e-15,   2.69278198e-13,
          5.78023065e-16,   3.81639537e-14,   1.16691189e-13,
          1.10043034e-11,   3.89027040e-11,   3.12854414e-15,
          6.28750592e-14,   2.68375789e-13,   1.11711909e-13,
          3.98105567e-13,   6.77998781e-14,   7.66843999e-15,
          1.01852598e-11,   4.41037265e-15,   1.58779172e-13,
          4.43581288e-13,   3.22187941e-13,   1.92790174e-13,
          5.22612870e-16,   1.69734246e-12,   3.32247149e-14,
          8.63261285e-13,   4.86761673e-13,   1.55195464e-13,
          4.56483801e-15,   1.04152770e-13,   9.84451337e-16,
          3.29653568e-13,   8.38885507e-14,   2.04935000e-13,
          1.35106635e-18,   2.32616335e-13,   7.12243154e-15,
          1.59146109e-16,   1.15002313e-11,   1.20310845e-10,
          2.45535927e-12,   3.91693388e-18,   1.99571222e-13,
          7.80286252e-12,   4.48433981e-15,   5.76173359e-14,
          2.02171318e-11,   1.41926909e-14]], dtype=float32)]
0
    Minibatch loss at step 6, tstep: 0: 8.567719,
    Learning rate at step 6, tstep: 0: 0.499650
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 7
[array([[  9.99613822e-01,   1.70415171e-06,   4.34863182e-07,
          1.91189592e-05,   9.60919351e-07,   6.27502322e-06,
          4.86226327e-07,   3.40465044e-06,   4.61775198e-06,
          1.27271451e-05,   3.06550937e-05,   5.22123514e-07,
          6.72738679e-06,   4.66480242e-06,   4.31219678e-06,
          3.87608179e-06,   2.82107408e-06,   1.94755034e-06,
          1.83990305e-05,   1.77607080e-06,   4.60162664e-06,
          6.06643061e-06,   3.56960845e-06,   5.81537051e-06,
          8.70779104e-07,   1.53422079e-05,   3.31733668e-06,
          1.25709075e-05,   6.20259107e-06,   4.42166265e-06,
          1.47033484e-06,   4.32007528e-06,   4.79055757e-07,
          5.93816094e-06,   4.97673591e-06,   1.09718521e-05,
          3.10418784e-08,   3.05575327e-06,   9.42870145e-07,
          3.39001701e-07,   3.57149002e-05,   5.08554986e-05,
          1.16840429e-05,   6.21534539e-08,   7.33912839e-06,
          1.39439244e-05,   1.24283440e-06,   4.88821888e-06,
          3.71526039e-05,   2.50859603e-06]], dtype=float32)]
0
    Minibatch loss at step 7, tstep: 0: 8.482744,
    Learning rate at step 7, tstep: 0: 0.499600
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 8
[array([[  1.00000000e+00,   8.63350624e-12,   5.45213776e-13,
          8.51979098e-10,   3.20761278e-12,   1.37589690e-10,
          7.28239192e-13,   2.62417275e-11,   6.28010838e-11,
          2.36443176e-09,   2.99762837e-09,   2.47601917e-12,
          3.74038751e-11,   1.06467182e-10,   4.67194096e-11,
          9.46389772e-11,   3.12044557e-11,   4.64937724e-12,
          1.48580859e-09,   7.02156172e-12,   1.10252765e-10,
          2.13480206e-10,   1.09992522e-10,   6.22336141e-11,
          6.90304151e-13,   3.93842764e-10,   1.85265050e-11,
          2.26226565e-10,   1.33558095e-10,   5.08660163e-11,
          3.99662378e-12,   4.85157747e-11,   1.41495127e-12,
          1.55264690e-10,   5.02903830e-11,   7.63187430e-11,
          8.00066749e-15,   5.27919028e-11,   3.77552850e-12,
          3.71748178e-13,   2.70415712e-09,   1.22685053e-08,
          8.87298013e-10,   7.89525001e-15,   8.70911121e-11,
          1.52289259e-09,   4.65909776e-12,   3.19894458e-11,
          3.14527671e-09,   8.08642476e-12]], dtype=float32)]
0
    Minibatch loss at step 8, tstep: 0: 8.397845,
    Learning rate at step 8, tstep: 0: 0.499550
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

[[ 0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
   0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]
Determining label for offset: 9
[array([[  9.98305798e-01,   1.36950803e-05,   2.30416322e-06,
          8.07002871e-05,   3.53741461e-06,   1.76431859e-05,
          2.38917164e-06,   1.62862652e-05,   1.93832020e-05,
          6.07849688e-05,   1.33768204e-04,   3.34213723e-06,
          1.80392562e-05,   1.82442400e-05,   1.69674495e-05,
          2.33953251e-05,   9.09646224e-06,   8.05324908e-06,
          1.25481209e-04,   5.56962596e-06,   1.81449705e-05,
          2.16382523e-05,   1.87984206e-05,   1.84354940e-05,
          3.25841484e-06,   5.27881857e-05,   1.21223884e-05,
          4.98025693e-05,   2.62408812e-05,   2.66417883e-05,
          6.27451482e-06,   1.32253817e-05,   2.73217552e-06,
          2.85367096e-05,   1.57314480e-05,   2.01715320e-05,
          4.00276377e-07,   2.20284019e-05,   4.79882283e-06,
          3.10576638e-06,   1.44220976e-04,   2.91188568e-04,
          4.26466031e-05,   5.63188564e-07,   3.19230458e-05,
          7.92963183e-05,   4.80389599e-06,   1.84890541e-05,
          1.30876491e-04,   6.94524169e-06]], dtype=float32)]
0
    Minibatch loss at step 9, tstep: 0: 8.315767,
    Learning rate at step 9, tstep: 0: 0.499500
    Minibatch accuracy: 100.0%
    Validation accuracy: 10.0%

Final test accuracy: 10.0%


In [ ]:


In [ ]: