[Study Notes] Week1_Programming Assignments_Convolutional Model: application

1. Tensorflow needs to create Placeholders (placeholders) for the input data, which will be fed (feed) to the Model (model) when running the Session (session)

2、Tensorflow:tf.placeholder

    Create placeholders, e.g.

# GRADED FUNCTION: create_placeholders

def create_placeholders(n_H0, n_W0, n_C0, n_y):
    """
    Creates the placeholders for the tensorflow session.
    
    Arguments:
    n_H0 -- scalar, height of an input image
    n_W0 -- scalar, width of an input image
    n_C0 -- scalar, number of channels of the input
    n_y -- scalar, number of classes
        
    Returns:
    X -- placeholder for the data input, of shape [None, n_H0, n_W0, n_C0] and dtype "float"
    Y -- placeholder for the input labels, of shape [None, n_y] and dtype "float"
    """

    ### START CODE HERE ### (≈2 lines)
    X = tf.placeholder(tf.float32, shape = [None, n_H0, n_W0, n_C0], name = 'X')
    Y = tf.placeholder(tf.float32, shape = [None, n_y], name = 'Y')
    ### END CODE HERE ###
    
    return X, Y

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325523901&siteId=291194637