Skip to content

Instantly share code, notes, and snippets.

@SuvroBaner
Created December 31, 2019 10:57
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 SuvroBaner/abf034c780095f1cc4c6ef8fa1628610 to your computer and use it in GitHub Desktop.
Save SuvroBaner/abf034c780095f1cc4c6ef8fa1628610 to your computer and use it in GitHub Desktop.
def create_placeholders(n_x, n_y):
"""
Arguments:
n_x -- scalar, size of an image vector (64 * 64 * 3 = 12288)
n_y -- scalar, number of classes (from 0 to 5, so n_y = 6)
Returns:
X -- placeholder for the data input, of shape [n_x, None] and dtype "tf.float32"
Y -- placeholder for the input labels, of shape [n_y, None] and dtype "tf.float32"
You will use None because it let's us be flexible on the number of examples you will for the placeholders.
In fact, the number of examples during test/train is different.
"""
X = tf.placeholder(tf.float32, shape = [n_x, None], name = 'X')
Y = tf.placeholder(tf.float32, shape = [n_y, None], name = 'Y')
return X, Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment