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变量,使用的是零初始化。

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

  • 相关阅读:
    CF1109D Sasha and Interesting Fact from Graph Theory 组合数
    和与或 数位dp
    G
    E. String Multiplication dp
    Obtain a Permutation 乱搞
    CF1061E Politics 费用流
    mysql连接报错
    编译安装nginx
    SQL四种语言:DDL,DML,DCL,TCL
    Linux 常用管理命令
  • 原文地址:https://www.cnblogs.com/lijiawei1-2-3/p/14276561.html
Copyright © 2011-2022 走看看