Skip to content

Instantly share code, notes, and snippets.

@vernwalrahul
Created July 30, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vernwalrahul/912e5a9af38d8963376018702fefa519 to your computer and use it in GitHub Desktop.
Save vernwalrahul/912e5a9af38d8963376018702fefa519 to your computer and use it in GitHub Desktop.
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
def max_pool_2x2(x):
return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],strides=[1, 2, 2, 1], padding='SAME')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment