code: """
  This is simple Alexnet train implementation modified for Kaggle mnist data.
  """
  
  import time
  import tensorflow as tf
  
  import logging
  tf.get_logger().setLevel(logging.ERROR)
  
  import kaggle_mnist_input as loader
  import os
  import csv
  
  FLAGS = tf.app.flags.FLAGS
  
  tf.app.flags.DEFINE_integer('training_epoch', 30, "training epoch")
  tf.app.flags.DEFINE_integer('batch_size', 128, "batch size")
  tf.app.flags.DEFINE_integer('validation_interval', 100, "validation interval")
  
  tf.app.flags.DEFINE_float('dropout_keep_prob', 0.5, "dropout keep prob")
  tf.app.flags.DEFINE_float('learning_rate', 0.001, "learning rate")
  tf.app.flags.DEFINE_float('rms_decay', 0.9, "rms optimizer decay")
  tf.app.flags.DEFINE_float('weight_decay', 0.0005, "l2 regularization weight decay")
  tf.app.flags.DEFINE_string('train_path', 'data/train.csv', "path to download training data")
  tf.app.flags.DEFINE_string('test_path', 'data/test.csv', "path to download test data")
  tf.app.flags.DEFINE_integer('validation_size', 2000, "validation size in training data")
  tf.app.flags.DEFINE_string('save_name', os.getcwd() + '/var.ckpt', "path to save variables")
  tf.app.flags.DEFINE_boolean('is_train', True, "True for train, False for test")
  tf.app.flags.DEFINE_string('test_result', 'result.csv', "test file path")
  
  image_size = 28
  image_channel = 1
  label_cnt = 10
  
  inputs = tf.placeholder("float", [None, image_size, image_size, image_channel])
  labels = tf.placeholder("float", [None, label_cnt])
  dropout_keep_prob = tf.placeholder("float", None)
  learning_rate_ph = tf.placeholder("float", None)
  
  # conv layer 1
  conv1_weights = tf.Variable(tf.random_normal([7, 7, image_channel, 96], dtype=tf.float32, stddev=0.01))
  conv1_biases = tf.Variable(tf.constant(0.0, shape=[96], dtype=tf.float32))
  conv1 = tf.nn.conv2d(inputs, conv1_weights, [1, 3, 3, 1], padding='SAME')
  conv1 = tf.nn.bias_add(conv1, conv1_biases)
  conv1_relu = tf.nn.relu(conv1)
  conv1_norm = tf.nn.local_response_normalization(conv1_relu, depth_radius=2, alpha=0.0001, beta=0.75, bias=1.0)
  conv1_pool = tf.nn.max_pool(conv1_norm, ksize=[1, 2, 2, 1], strides=[1, 1, 1, 1], padding='VALID')
  
  # conv layer 2
  conv2_weights = tf.Variable(tf.random_normal([5, 5, 96, 256], dtype=tf.float32, stddev=0.01))
  conv2_biases = tf.Variable(tf.constant(1.0, shape=[256], dtype=tf.float32))
  conv2 = tf.nn.conv2d(conv1_pool, conv2_weights, [1, 1, 1, 1], padding='SAME')
  conv2 = tf.nn.bias_add(conv2, conv2_biases)
  conv2_relu = tf.nn.relu(conv2)
  conv2_norm = tf.nn.local_response_normalization(conv2_relu)
  conv2_pool = tf.nn.max_pool(conv2_norm, ksize=[1, 2, 2, 1], strides=[1, 1, 1, 1], padding='VALID')
  
  # conv layer 3
  conv3_weights = tf.Variable(tf.random_normal([3, 3, 256, 384], dtype=tf.float32, stddev=0.01))
  conv3_biases = tf.Variable(tf.constant(0.0, shape=[384], dtype=tf.float32))
  conv3 = tf.nn.conv2d(conv2_pool, conv3_weights, [1, 1, 1, 1], padding='SAME')
  conv3 = tf.nn.bias_add(conv3, conv3_biases)
  conv3_relu = tf.nn.relu(conv3)
  
  # conv layer 4
  conv4_weights = tf.Variable(tf.random_normal([3, 3, 384, 384], dtype=tf.float32, stddev=0.01))
  conv4_biases = tf.Variable(tf.constant(1.0, shape=[384], dtype=tf.float32))
  conv4 = tf.nn.conv2d(conv3_relu, conv4_weights, [1, 1, 1, 1], padding='SAME')
  conv4 = tf.nn.bias_add(conv4, conv4_biases)
  conv4_relu = tf.nn.relu(conv4)
  
  # conv layer 5
  conv5_weights = tf.Variable(tf.random_normal([3, 3, 384, 256], dtype=tf.float32, stddev=0.01))
  conv5_biases = tf.Variable(tf.constant(1.0, shape=[256], dtype=tf.float32))
  conv5 = tf.nn.conv2d(conv4_relu, conv5_weights, [1, 1, 1, 1], padding='SAME')
  conv5 = tf.nn.bias_add(conv5, conv5_biases)
  conv5_relu = tf.nn.relu(conv5)
  conv5_pool = tf.nn.max_pool(conv5_relu, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='VALID')
  
  # fc layer 1
  fc1_weights = tf.Variable(tf.random_normal([256 * 3 * 3, 4096], dtype=tf.float32, stddev=0.01))
  fc1_biases = tf.Variable(tf.constant(1.0, shape=[4096], dtype=tf.float32))
  conv5_reshape = tf.reshape(conv5_pool, [-1, fc1_weights.get_shape().as_list()[0]])
  fc1 = tf.matmul(conv5_reshape, fc1_weights)
  fc1 = tf.nn.bias_add(fc1, fc1_biases)
  fc1_relu = tf.nn.relu(fc1)
  fc1_drop = tf.nn.dropout(fc1_relu, dropout_keep_prob)
  
  # fc layer 2
  fc2_weights = tf.Variable(tf.random_normal([4096, 4096], dtype=tf.float32, stddev=0.01))
  fc2_biases = tf.Variable(tf.constant(1.0, shape=[4096], dtype=tf.float32))
  fc2 = tf.matmul(fc1_drop, fc2_weights)
  fc2 = tf.nn.bias_add(fc2, fc2_biases)
  fc2_relu = tf.nn.relu(fc2)
  fc2_drop = tf.nn.dropout(fc2_relu, dropout_keep_prob)
  
  # fc layer 3 - output
  fc3_weights = tf.Variable(tf.random_normal([4096, label_cnt], dtype=tf.float32, stddev=0.01))
  fc3_biases = tf.Variable(tf.constant(1.0, shape=[label_cnt], dtype=tf.float32))
  fc3 = tf.matmul(fc2_drop, fc3_weights)
  logits = tf.nn.bias_add(fc3, fc3_biases)
  
  # loss
  loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=labels))
  # l2 regularization
  regularizers = (tf.nn.l2_loss(conv1_weights) + tf.nn.l2_loss(conv1_biases) +
                  tf.nn.l2_loss(conv2_weights) + tf.nn.l2_loss(conv2_biases) +
                  tf.nn.l2_loss(conv3_weights) + tf.nn.l2_loss(conv3_biases) +
                  tf.nn.l2_loss(conv4_weights) + tf.nn.l2_loss(conv4_biases) +
                  tf.nn.l2_loss(conv5_weights) + tf.nn.l2_loss(conv5_biases) +
                  tf.nn.l2_loss(fc1_weights) + tf.nn.l2_loss(fc1_biases) +
                  tf.nn.l2_loss(fc2_weights) + tf.nn.l2_loss(fc2_biases) +
                  tf.nn.l2_loss(fc3_weights) + tf.nn.l2_loss(fc3_biases))
  loss += FLAGS.weight_decay * regularizers
  
  # accuracy
  predict = tf.argmax(logits, 1)
  accuracy = tf.reduce_mean(tf.cast(tf.equal(predict, tf.argmax(labels, 1)), tf.float32))
  
  # train
  train = tf.train.RMSPropOptimizer(learning_rate_ph, FLAGS.rms_decay).minimize(loss)
  # train = tf.train.MomentumOptimizer(learning_rate_ph, FLAGS.momentum).minimize(loss)
  
  # session
  init = tf.initialize_all_variables()
  sess = tf.Session()
  sess.run(init)
  
  # tf saver
  saver = tf.train.Saver()
  if os.path.isfile(FLAGS.save_name):
      saver.restore(sess, FLAGS.save_name)
  
  total_start_time = time.time()
  
  # begin training
  if FLAGS.is_train:
      # load mnist data
      train_images, train_labels, train_range, validation_images, validation_labels, validation_indices = loader.load_mnist_train(
          FLAGS.validation_size, FLAGS.batch_size)
      
      total_train_len = len(train_images)
      i = 0
      learning_rate = FLAGS.learning_rate
  
      for epoch in range(FLAGS.training_epoch):
          epoch_start_time = time.time()
  
          overall_loss = 0.0
          for start, end in train_range:
              batch_start_time = time.time()
              trainX = train_images[start:end]
              trainY = train_labels[start:end]
              _, loss_result = sess.run([train, loss], feed_dict={inputs: trainX, labels: trainY,
                                                                  dropout_keep_prob: FLAGS.dropout_keep_prob,
                                                                  learning_rate_ph: learning_rate})
              #print('[%s][training][epoch %d, step %d exec %.2f seconds] [file: %5d ~ %5d / %5d] loss : %3.10f' % (
              #    time.strftime("%Y-%m-%d %H:%M:%S"), epoch, i, (time.time() - batch_start_time), start, end,
              #    total_train_len, loss_result))
              overall_loss += loss_result
  
              if i % FLAGS.validation_interval == 0 and i > 0:
                  validation_start_time = time.time()
                  shuffle_indices = loader.shuffle_validation(validation_indices, FLAGS.batch_size)
                  validationX = validation_images[shuffle_indices]
                  validationY = validation_labels[shuffle_indices]
                  accuracy_result, loss_result = sess.run([accuracy, loss],
                                                          feed_dict={inputs: validationX, labels: validationY,
                                                                     dropout_keep_prob: 1.0})
                  #print('[%s][validation][epoch %d, step %d exec %.2f seconds] accuracy : %1.3f, loss : %3.10f' % (
                  #    time.strftime("%Y-%m-%d %H:%M:%S"), epoch, i, (time.time() - validation_start_time),
                  #    accuracy_result, loss_result))
  
              i += 1
  
          overall_loss /= len(train_range)
          print("[%s][epoch exec %s seconds] epoch : %d, loss: %3.10f" % (
              time.strftime("%Y-%m-%d %H:%M:%S"), (time.time() - epoch_start_time), epoch + 1, overall_loss))
          saver.save(sess, FLAGS.save_name)
          print()
  # begin test
  else:
      i = 1
      test_images, test_ranges = loader.load_mnist_test(FLAGS.batch_size)
  
      test_result_file = open(FLAGS.test_result, 'wb')
      csv_writer = csv.writer(test_result_file)
      csv_writer.writerow(['ImageId', 'Label'])
  
      for file_start, file_end in test_ranges:
          testX = test_images[file_start:file_end]
          predict_label = sess.run(predict, feed_dict={inputs: testX, dropout_keep_prob: 1.0})
  
          for cur_predict in predict_label:
              csv_writer.writerow([i, cur_predict])
              print('[Result %s: %s]' % (i, cur_predict))
              i += 1
  
  print("[%s][total exec %s seconds" % (time.strftime("%Y-%m-%d %H:%M:%S"), (time.time() - total_start_time)))
  
apis: tensorflow.nn.softmax_cross_entropy_with_logits tensorflow.nn.max_pool tensorflow.nn.l2_loss tensorflow.app.flags.DEFINE_string tensorflow.app.flags.DEFINE_boolean tensorflow.nn.conv2d tensorflow.app.flags.DEFINE_integer tensorflow.initialize_all_variables tensorflow.Session tensorflow.train.Saver tensorflow.argmax tensorflow.nn.dropout tensorflow.matmul tensorflow.train.RMSPropOptimizer tensorflow.placeholder tensorflow.nn.bias_add tensorflow.nn.relu tensorflow.constant tensorflow.get_logger tensorflow.app.flags.DEFINE_float tensorflow.nn.local_response_normalization tensorflow.random_normal
api_extract: [(17, 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""training_epoch"""', '(30)', '"""training epoch"""'], {}), True, 'import tensorflow as tf\n'), (18, 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""batch_size"""', '(128)', '"""batch size"""'], {}), True, 'import tensorflow as tf\n'), (19, 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""validation_interval"""', '(100)', '"""validation interval"""'], {}), True, 'import tensorflow as tf\n'), (21, 'tensorflow.app.flags.DEFINE_float', 'tf.app.flags.DEFINE_float', (['"""dropout_keep_prob"""', '(0.5)', '"""dropout keep prob"""'], {}), True, 'import tensorflow as tf\n'), (22, 'tensorflow.app.flags.DEFINE_float', 'tf.app.flags.DEFINE_float', (['"""learning_rate"""', '(0.001)', '"""learning rate"""'], {}), True, 'import tensorflow as tf\n'), (23, 'tensorflow.app.flags.DEFINE_float', 'tf.app.flags.DEFINE_float', (['"""rms_decay"""', '(0.9)', '"""rms optimizer decay"""'], {}), True, 'import tensorflow as tf\n'), (24, 'tensorflow.app.flags.DEFINE_float', 'tf.app.flags.DEFINE_float', (['"""weight_decay"""', '(0.0005)', '"""l2 regularization weight decay"""'], {}), True, 'import tensorflow as tf\n'), (25, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""train_path"""', '"""data/train.csv"""', '"""path to download training data"""'], {}), True, 'import tensorflow as tf\n'), (26, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""test_path"""', '"""data/test.csv"""', '"""path to download test data"""'], {}), True, 'import tensorflow as tf\n'), (27, 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""validation_size"""', '(2000)', '"""validation size in training data"""'], {}), True, 'import tensorflow as tf\n'), (29, 'tensorflow.app.flags.DEFINE_boolean', 'tf.app.flags.DEFINE_boolean', (['"""is_train"""', '(True)', '"""True for train, False for test"""'], {}), True, 'import tensorflow as tf\n'), (30, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""test_result"""', '"""result.csv"""', '"""test file path"""'], {}), True, 'import tensorflow as tf\n'), (36, 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', '[None, image_size, image_size, image_channel]'], {}), True, 'import tensorflow as tf\n'), (37, 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', '[None, label_cnt]'], {}), True, 'import tensorflow as tf\n'), (38, 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', 'None'], {}), True, 'import tensorflow as tf\n'), (39, 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', 'None'], {}), True, 'import tensorflow as tf\n'), (44, 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['inputs', 'conv1_weights', '[1, 3, 3, 1]'], {'padding': '"""SAME"""'}), True, 'import tensorflow as tf\n'), (45, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['conv1', 'conv1_biases'], {}), True, 'import tensorflow as tf\n'), (46, 'tensorflow.nn.relu', 'tf.nn.relu', (['conv1'], {}), True, 'import tensorflow as tf\n'), (47, 'tensorflow.nn.local_response_normalization', 'tf.nn.local_response_normalization', (['conv1_relu'], {'depth_radius': '(2)', 'alpha': '(0.0001)', 'beta': '(0.75)', 'bias': '(1.0)'}), True, 'import tensorflow as tf\n'), (48, 'tensorflow.nn.max_pool', 'tf.nn.max_pool', (['conv1_norm'], {'ksize': '[1, 2, 2, 1]', 'strides': '[1, 1, 1, 1]', 'padding': '"""VALID"""'}), True, 'import tensorflow as tf\n'), (53, 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['conv1_pool', 'conv2_weights', '[1, 1, 1, 1]'], {'padding': '"""SAME"""'}), True, 'import tensorflow as tf\n'), (54, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['conv2', 'conv2_biases'], {}), True, 'import tensorflow as tf\n'), (55, 'tensorflow.nn.relu', 'tf.nn.relu', (['conv2'], {}), True, 'import tensorflow as tf\n'), (56, 'tensorflow.nn.local_response_normalization', 'tf.nn.local_response_normalization', (['conv2_relu'], {}), True, 'import tensorflow as tf\n'), (57, 'tensorflow.nn.max_pool', 'tf.nn.max_pool', (['conv2_norm'], {'ksize': '[1, 2, 2, 1]', 'strides': '[1, 1, 1, 1]', 'padding': '"""VALID"""'}), True, 'import tensorflow as tf\n'), (62, 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['conv2_pool', 'conv3_weights', '[1, 1, 1, 1]'], {'padding': '"""SAME"""'}), True, 'import tensorflow as tf\n'), (63, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['conv3', 'conv3_biases'], {}), True, 'import tensorflow as tf\n'), (64, 'tensorflow.nn.relu', 'tf.nn.relu', (['conv3'], {}), True, 'import tensorflow as tf\n'), (69, 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['conv3_relu', 'conv4_weights', '[1, 1, 1, 1]'], {'padding': '"""SAME"""'}), True, 'import tensorflow as tf\n'), (70, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['conv4', 'conv4_biases'], {}), True, 'import tensorflow as tf\n'), (71, 'tensorflow.nn.relu', 'tf.nn.relu', (['conv4'], {}), True, 'import tensorflow as tf\n'), (76, 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['conv4_relu', 'conv5_weights', '[1, 1, 1, 1]'], {'padding': '"""SAME"""'}), True, 'import tensorflow as tf\n'), (77, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['conv5', 'conv5_biases'], {}), True, 'import tensorflow as tf\n'), (78, 'tensorflow.nn.relu', 'tf.nn.relu', (['conv5'], {}), True, 'import tensorflow as tf\n'), (79, 'tensorflow.nn.max_pool', 'tf.nn.max_pool', (['conv5_relu'], {'ksize': '[1, 3, 3, 1]', 'strides': '[1, 2, 2, 1]', 'padding': '"""VALID"""'}), True, 'import tensorflow as tf\n'), (85, 'tensorflow.matmul', 'tf.matmul', (['conv5_reshape', 'fc1_weights'], {}), True, 'import tensorflow as tf\n'), (86, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['fc1', 'fc1_biases'], {}), True, 'import tensorflow as tf\n'), (87, 'tensorflow.nn.relu', 'tf.nn.relu', (['fc1'], {}), True, 'import tensorflow as tf\n'), (88, 'tensorflow.nn.dropout', 'tf.nn.dropout', (['fc1_relu', 'dropout_keep_prob'], {}), True, 'import tensorflow as tf\n'), (93, 'tensorflow.matmul', 'tf.matmul', (['fc1_drop', 'fc2_weights'], {}), True, 'import tensorflow as tf\n'), (94, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['fc2', 'fc2_biases'], {}), True, 'import tensorflow as tf\n'), (95, 'tensorflow.nn.relu', 'tf.nn.relu', (['fc2'], {}), True, 'import tensorflow as tf\n'), (96, 'tensorflow.nn.dropout', 'tf.nn.dropout', (['fc2_relu', 'dropout_keep_prob'], {}), True, 'import tensorflow as tf\n'), (101, 'tensorflow.matmul', 'tf.matmul', (['fc2_drop', 'fc3_weights'], {}), True, 'import tensorflow as tf\n'), (102, 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['fc3', 'fc3_biases'], {}), True, 'import tensorflow as tf\n'), (118, 'tensorflow.argmax', 'tf.argmax', (['logits', '(1)'], {}), True, 'import tensorflow as tf\n'), (126, 'tensorflow.initialize_all_variables', 'tf.initialize_all_variables', ([], {}), True, 'import tensorflow as tf\n'), (127, 'tensorflow.Session', 'tf.Session', ([], {}), True, 'import tensorflow as tf\n'), (131, 'tensorflow.train.Saver', 'tf.train.Saver', ([], {}), True, 'import tensorflow as tf\n'), (132, 'os.path.isfile', 'os.path.isfile', (['FLAGS.save_name'], {}), False, 'import os\n'), (135, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (42, 'tensorflow.random_normal', 'tf.random_normal', (['[7, 7, image_channel, 96]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (43, 'tensorflow.constant', 'tf.constant', (['(0.0)'], {'shape': '[96]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (51, 'tensorflow.random_normal', 'tf.random_normal', (['[5, 5, 96, 256]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (52, 'tensorflow.constant', 'tf.constant', (['(1.0)'], {'shape': '[256]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (60, 'tensorflow.random_normal', 'tf.random_normal', (['[3, 3, 256, 384]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (61, 'tensorflow.constant', 'tf.constant', (['(0.0)'], {'shape': '[384]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (67, 'tensorflow.random_normal', 'tf.random_normal', (['[3, 3, 384, 384]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (68, 'tensorflow.constant', 'tf.constant', (['(1.0)'], {'shape': '[384]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (74, 'tensorflow.random_normal', 'tf.random_normal', (['[3, 3, 384, 256]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (75, 'tensorflow.constant', 'tf.constant', (['(1.0)'], {'shape': '[256]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (82, 'tensorflow.random_normal', 'tf.random_normal', (['[256 * 3 * 3, 4096]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (83, 'tensorflow.constant', 'tf.constant', (['(1.0)'], {'shape': '[4096]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (91, 'tensorflow.random_normal', 'tf.random_normal', (['[4096, 4096]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (92, 'tensorflow.constant', 'tf.constant', (['(1.0)'], {'shape': '[4096]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (99, 'tensorflow.random_normal', 'tf.random_normal', (['[4096, label_cnt]'], {'dtype': 'tf.float32', 'stddev': '(0.01)'}), True, 'import tensorflow as tf\n'), (100, 'tensorflow.constant', 'tf.constant', (['(1.0)'], {'shape': '[label_cnt]', 'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (105, 'tensorflow.nn.softmax_cross_entropy_with_logits', 'tf.nn.softmax_cross_entropy_with_logits', ([], {'logits': 'logits', 'labels': 'labels'}), True, 'import tensorflow as tf\n'), (114, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['fc3_biases'], {}), True, 'import tensorflow as tf\n'), (140, 'kaggle_mnist_input.load_mnist_train', 'loader.load_mnist_train', (['FLAGS.validation_size', 'FLAGS.batch_size'], {}), True, 'import kaggle_mnist_input as loader\n'), (185, 'kaggle_mnist_input.load_mnist_test', 'loader.load_mnist_test', (['FLAGS.batch_size'], {}), True, 'import kaggle_mnist_input as loader\n'), (188, 'csv.writer', 'csv.writer', (['test_result_file'], {}), False, 'import csv\n'), (9, 'tensorflow.get_logger', 'tf.get_logger', ([], {}), True, 'import tensorflow as tf\n'), (28, 'os.getcwd', 'os.getcwd', ([], {}), False, 'import os\n'), (114, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['fc3_weights'], {}), True, 'import tensorflow as tf\n'), (122, 'tensorflow.train.RMSPropOptimizer', 'tf.train.RMSPropOptimizer', (['learning_rate_ph', 'FLAGS.rms_decay'], {}), True, 'import tensorflow as tf\n'), (148, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (113, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['fc2_biases'], {}), True, 'import tensorflow as tf\n'), (119, 'tensorflow.argmax', 'tf.argmax', (['labels', '(1)'], {}), True, 'import tensorflow as tf\n'), (152, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (200, 'time.strftime', 'time.strftime', (['"""%Y-%m-%d %H:%M:%S"""'], {}), False, 'import time\n'), (113, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['fc2_weights'], {}), True, 'import tensorflow as tf\n'), (164, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (165, 'kaggle_mnist_input.shuffle_validation', 'loader.shuffle_validation', (['validation_indices', 'FLAGS.batch_size'], {}), True, 'import kaggle_mnist_input as loader\n'), (200, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (112, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['fc1_biases'], {}), True, 'import tensorflow as tf\n'), (179, 'time.strftime', 'time.strftime', (['"""%Y-%m-%d %H:%M:%S"""'], {}), False, 'import time\n'), (112, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['fc1_weights'], {}), True, 'import tensorflow as tf\n'), (179, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (111, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv5_biases'], {}), True, 'import tensorflow as tf\n'), (111, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv5_weights'], {}), True, 'import tensorflow as tf\n'), (110, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv4_biases'], {}), True, 'import tensorflow as tf\n'), (110, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv4_weights'], {}), True, 'import tensorflow as tf\n'), (109, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv3_biases'], {}), True, 'import tensorflow as tf\n'), (109, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv3_weights'], {}), True, 'import tensorflow as tf\n'), (108, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv2_biases'], {}), True, 'import tensorflow as tf\n'), (108, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv2_weights'], {}), True, 'import tensorflow as tf\n'), (107, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv1_weights'], {}), True, 'import tensorflow as tf\n'), (107, 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['conv1_biases'], {}), True, 'import tensorflow as tf\n')]