neural_network.input_data ========================= .. py:module:: neural_network.input_data .. autoapi-nested-parse:: Functions for downloading and reading MNIST data (deprecated). This module and all its submodules are deprecated. Attributes ---------- .. autoapisummary:: neural_network.input_data.DEFAULT_SOURCE_URL Classes ------- .. autoapisummary:: neural_network.input_data._DataSet neural_network.input_data._Datasets Functions --------- .. autoapisummary:: neural_network.input_data._dense_to_one_hot neural_network.input_data._extract_images neural_network.input_data._extract_labels neural_network.input_data._maybe_download neural_network.input_data._read32 neural_network.input_data.read_data_sets Module Contents --------------- .. py:class:: _DataSet(images, labels, fake_data=False, one_hot=False, dtype=dtypes.float32, reshape=True, seed=None) Container class for a _DataSet (deprecated). THIS CLASS IS DEPRECATED. .. py:method:: next_batch(batch_size, fake_data=False, shuffle=True) Return the next `batch_size` examples from this data set. .. py:attribute:: _epochs_completed :value: 0 .. py:attribute:: _images .. py:attribute:: _index_in_epoch :value: 0 .. py:attribute:: _labels .. py:attribute:: _rng .. py:property:: epochs_completed .. py:property:: images .. py:property:: labels .. py:property:: num_examples .. py:class:: _Datasets Bases: :py:obj:`NamedTuple` .. py:attribute:: test :type: _DataSet .. py:attribute:: train :type: _DataSet .. py:attribute:: validation :type: _DataSet .. py:function:: _dense_to_one_hot(labels_dense, num_classes) Convert class labels from scalars to one-hot vectors. .. py:function:: _extract_images(f) Extract the images into a 4D uint8 numpy array [index, y, x, depth]. Args: f: A file object that can be passed into a gzip reader. Returns: data: A 4D uint8 numpy array [index, y, x, depth]. Raises: ValueError: If the bytestream does not start with 2051. .. py:function:: _extract_labels(f, one_hot=False, num_classes=10) Extract the labels into a 1D uint8 numpy array [index]. Args: f: A file object that can be passed into a gzip reader. one_hot: Does one hot encoding for the result. num_classes: Number of classes for the one hot encoding. Returns: labels: a 1D uint8 numpy array. Raises: ValueError: If the bystream doesn't start with 2049. .. py:function:: _maybe_download(filename, work_directory, source_url) Download the data from source url, unless it's already here. Args: filename: string, name of the file in the directory. work_directory: string, path to working directory. source_url: url to download from if file doesn't exist. Returns: Path to resulting file. .. py:function:: _read32(bytestream) .. py:function:: read_data_sets(train_dir, fake_data=False, one_hot=False, dtype=dtypes.float32, reshape=True, validation_size=5000, seed=None, source_url=DEFAULT_SOURCE_URL) .. py:data:: DEFAULT_SOURCE_URL :value: 'https://storage.googleapis.com/cvdf-datasets/mnist/'