TensorFlow Learning notes use TensorFlow for Mnist classification (1)

Source: Internet
Author: User

Mnist is an entry-level computer-vision dataset that contains 60,000 training data and 10,000 test data. Each sample is a variety of handwritten digital pictures below:

It also contains the corresponding label for each picture, telling us this is a number. For example, the above four pictures are labeled 5,0,4,1.

Mnist's official website: http://yann.lecun.com/exdb/mnist/

You can view the current maximum record for the project: http://rodrigob.github.io/are_we_there_yet/build/classification_datasets_results.html

Visit the above Web site to view the Mnist classification and the classification model used.

The purpose of this paper is to learn to use TensorFlow for large dataset processing, rather than construct a complex model, and finally expect to achieve 99.2% accuracy, if you want to learn more complex models can refer to the above Web site.

TensorFlow is a very powerful library for large-scale numerical computations. One of the tasks that it specializes in is to implement and train deep neural networks.

In this tutorial, we will learn the basic steps of building a TensorFlow model and will build a deep convolution neural network for mnist through these steps.

Downloading data sets

The official website of the Mnist dataset is the Yann LeCun ' s website (http://yann.lecun.com/exdb/mnist/

)。 You can download the dataset directly.

It is recommended that Python crawler code be used to automatically download and install this dataset: https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/examples/ tutorials/mnist/input_data.py

Copy the above code, run the above code will automatically create a ' mnist_data ' directory to store the data.

The downloaded dataset is divided into two parts: a 60000-row training dataset (Mnist.train) and a 10000-row test DataSet (Mnist.test). Such segmentation is important in that the machine learning model design must have a separate test dataset that is not used for training but is used to evaluate the performance of the model, making it easier to generalize the design model to other datasets (generalizations).

As mentioned earlier, each Mnist data unit consists of two parts: a picture with handwritten digits and a corresponding label. We set these images to "XS" and set them to "Ys". Both the training dataset and the test dataset contain Xs and Ys, for example, the image of the training dataset is mnist.train.images, and the training dataset is labeled Mnist.train.labels.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.