zoukankan      html  css  js  c++  java
  • 学习进度笔记10

    今天通过观看老师分享的TensorFlow的教学视频,初步学习了什么是逻辑回归的架构:

    import tensorflow as tf
    import numpy as np
    import matplotlib.pyplot as plt
    from tensorflow.examples.tutorials.mnist import input_data

    mnist = input_data.read_data_sets('data/',one_hot=True)
    #print
    trainimg = mnist.train.images
    trainlabel = mnist.train.labels
    testimg = mnist.test.images
    testlabel = mnist.test.labels
    print("trainlabel:",type(trainlabel),"shape:",trainlabel.shape)
    print("trainimg:",type(trainimg),"shape:",trainimg.shape)
    print("testlabel:",type(testlabel),"shape:",testlabel.shape)
    print("testimg:",type(testimg),"shape:",testimg.shape)
    print(trainlabel[0])

     输出的最后一行表示trainlabel的第一行代表的元素是7.

    然后需要定义变量:

     首先利用TensorFlow的placeholder函数来对变量进行占坑,一遍后续数据的填入,其中None表示无穷。

    然后初始化W和b变量,使用的是零初始化。

     制定学习参数和梯度下降优化器

  • 相关阅读:
    python
    shader example
    shader 关键字
    Android Studio如何导出可供Unity使用的aar插件详解 转
    adb
    知识
    Unity实现模拟按键
    小知识
    图种制作命令
    八卦
  • 原文地址:https://www.cnblogs.com/lijiawei1-2-3/p/14276561.html
Copyright © 2011-2022 走看看