zoukankan      html  css  js  c++  java
  • TensorFlow_Classify_Images_OF_Clothing

    This guide trains a neural network model to classify images of clothing,like sneakers and shirts.It's okay if you don't understand all the details,this is a fast-paced overview of a complete TensorFlow program with the details explained as we go.This guide uses tf.keras,a high-level API to build and models in TensorFlow.

    本指南训练神经网络模型对服装图像进行分类,如运动鞋和衬衫。如果您不了解所有细节,这是一个完整的TensorFlow程序的快节奏概述,详细解释了我们去的细节 。本指南使用[tf.keras](https://www.tensorflow.org/guide/keras),这是一个在TensorFlow中构建和建模的高级API。

    # TensorFlow and tf.keras
    import tensorflow as tf
    from tensorflow import keras
    
    # Helper libraries
    import numpy as np
    import matplotlib.pyplot as plt
    
    print(tf.__version__)
    

    Import the Fashion MNIST dataset

    This guide uses the Fashion MNIST dataset which contains 70000 grayscale images in 10 categories.The images show individual articles of clothing at low resolution(28 by 28 pixel),as seen here:

    Figue 1: Fashion-MNIST samples

    Fashion MNIST is intended as a drop-in replacement for the classic MNIST dataset-often used as the "Hello,World" of machine learning programs for computer vision.The MNIST dataset contains images of handwritten digit(0,1,2,etc) in an identical format to the articles of clothing we'll use here.
    This guide uses Fashion MNIST for variety,and because it's a slightly more challenging problem than regular MNIST.Both datasets are relatively small and are used to verify that an algorithm works as expected.They're good starting points to test and debug code.
    We will use 60000 images to train the network and 10000 images to evaluate how accurately the network learned to classify images.You can access the Fashion MNIST directly from TensorFlow,just import and load the data:

    fashion_mnist = keras.datasets.fashion_mnist
    
    (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
    

    Loading the dataset returns four Numpy arrays:

    • The train_images and train_labels arrays are the training set—the data the model uses to learn.
    • The model is tested against the test set, the test_images, and test_labels arrays.

    Key board preferences of the Google Colab

    The First Column The Second Column
    Ctrl+M+H Keyboard preferences
    Ctrl+ F9 Run all cells in notebook
    Ctrl+ M+ D Delete Cell
    Ctrl+ M+ M Convert to text cell
    Ctrl+ M+ Y Convert to code cell
    runtime 代码执行程序
    Ctrl + ] Collapse all/selected sections
    shift + enter Run cell and select next cell 运行单元格并选择下一个单元格
    Alt + enter Run cell and insert new cell 运行单元格并插入新单元格
    collapse 折叠[]

    TO BE CONTINUED

  • 相关阅读:
    hdu 1823 Luck and Love 二维线段树
    UVA 12299 RMQ with Shifts 线段树
    HDU 4578 Transformation 线段树
    FZU 2105 Digits Count 线段树
    UVA 1513 Movie collection 树状数组
    UVA 1292 Strategic game 树形DP
    【ACM】hdu_zs2_1003_Problem C_201308031012
    qsort快速排序
    【ACM】nyoj_7_街区最短路径问题_201308051737
    【ACM】nyoj_540_奇怪的排序_201308050951
  • 原文地址:https://www.cnblogs.com/hugeng007/p/9581649.html
Copyright © 2011-2022 走看看