天天看点

tflearn.layers.input_data = tflearn.layers.core.input_data

input_data(shape=None, placeholder=None, dtype=tf.float32, data_preprocessing=None, data_augmentation=None, name='InputData')

    Input Data.

    This layer is used for inputting (aka. feeding) data to a network.

    A TensorFlow placeholder will be used if it is supplied,

    otherwise a new placeholder will be created with the given shape.

    Either a shape or placeholder must be provided, otherwise an

    exception will be raised.

    Furthermore, the placeholder is added to TensorFlow collections

    so it can be retrieved using tf.get_collection(tf.GraphKeys.INPUTS)

    as well as tf.GraphKeys.LAYER_TENSOR + '/' + name. Similarly for

    the data preprocessing and augmentation objects which are stored in

    the collections with tf.GraphKeys.DATA_PREP and tf.GraphKeys.DATA_AUG.

    This allows other parts of TFLearn to easily retrieve and use these

    objects by referencing these graph-keys.

    Input:

        List of `int` (Shape), to create a new placeholder.

            Or

        `Tensor` (Placeholder), to use an existing placeholder.

    Output:

        Placeholder Tensor with given shape.

    Arguments:

        shape: list of `int`. An array or tuple representing input data shape.

            It is required if no placeholder is provided. First element should

            be 'None' (representing batch size), if not provided, it will be

            added automatically.

        placeholder: A Placeholder to use for feeding this layer (optional).

            If not specified, a placeholder will be automatically created.

            You can retrieve that placeholder through graph key: 'INPUTS',

            or the 'placeholder' attribute of this function's returned tensor.

        dtype: `tf.type`, Placeholder data type (optional). Default: float32.

        data_preprocessing: A `DataPreprocessing` subclass object to manage

            real-time data pre-processing when training and predicting (such

            as zero center data, std normalization...).

        data_augmentation: `DataAugmentation`. A `DataAugmentation` subclass

            object to manage real-time data augmentation while training (

            such as random image crop, random image flip, random sequence

            reverse...).

        name: `str`. A name for this layer (optional).

继续阅读