![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
曲短情长丶
这个作者很懒,什么都没留下…
展开
-
Tensorflow2.0 笔记-3:神经网络优化过程
预备知识 tf.where() 条件语句真返回A,条件语句为假返回B tf. where(条件语句,真返回A,假返回B) a = tf.constant([1, 2, 3, 1, 1]) b = tf.constant([0, 1, 3, 4, 5]) c = tf.where(tf.greater(a, b), a, b) # 若a>b,返回a对应位置的元素,否则返回b对应位置的元素 print("c:", c) # c: tf.Tensor([1 2 3 4 5], shape=(5,), dt原创 2020-10-09 10:32:12 · 177 阅读 · 0 评论 -
Tensorflow2.0 笔记-2:神经网络实现鸢尾花分类
鸢尾花数据集(lris) 1、 读入数据 from sklearn import datasets from pandas import DataFrame import pandas as pd x_data = datasets.load_iris().data # .data返回iris数据集所有输入特征 y_data = datasets.load_iris().target # .target返回iris数据集所有标签 print("x_data from datasets: \n", x_原创 2020-10-08 17:59:09 · 453 阅读 · 1 评论 -
Tensorflow2.0 笔记-1
张量生成 创建一个张量 List item # tf.constant(张量内容,dtype=数据类型(可选)) import tensorflow as tf a = tf.constant([1,5],dtype=tf.int64) print(a) 根据逗号隔开的数字,代表是几维的张量 将numpy的数据类型转换为Tensor数据类型 tf.convert_to_tensor(数据名,dtype=数据类型(可选)) 创建全为0的张量 tf.zeros(维度) a=tf.zer原创 2020-10-08 16:45:49 · 118 阅读 · 0 评论