Skip to content

Instantly share code, notes, and snippets.

@Myeongjoon
Last active August 9, 2018 23:41
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 Myeongjoon/af289d8f2ecc5cc59aec2f776b2f872e to your computer and use it in GitHub Desktop.
Save Myeongjoon/af289d8f2ecc5cc59aec2f776b2f872e to your computer and use it in GitHub Desktop.
from __future__ import print_function
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
element_size = 28
time_steps = 28
num_classes = 10
batch_size = 128
hidden_layer_size = 128
LOG_DIR = "logs/RNN_with_summaries"
_inputs = tf.placeholder(tf.float32,
shape=[None, time_steps, element_size],
name='inputs')
y = tf.placeholder(tf.float32, shape=[None, num_classes], name='labels')
# Processing inputs to work with scan function
# Current input shape: (batch_size, time_steps, element_size)
processed_input = tf.transpose(_inputs, perm=[1, 0, 2])
# Current input shape now: (time_steps,batch_size, element_size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment