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

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

  • 相关阅读:
    Linux中的邮件发送
    Python学习笔记18-发送邮件
    Ansible学习笔记
    eclipse使用maven打包时去掉测试类
    CentOS安装redis
    spring boot 部署
    sprint boot 配置
    spring-boot 学习笔记一
    不要容忍破窗户
    阿里云安装Oracle
  • 原文地址:https://www.cnblogs.com/lijiawei1-2-3/p/14276561.html
Copyright © 2011-2022 走看看