首页 > 分享 > TensorFlow学习记录(一)

TensorFlow学习记录(一)

最新推荐文章于 2025-12-19 16:26:43 发布

原创 于 2021-12-07 12:28:41 发布 · 121 阅读

· 0

· 0 ·

CC 4.0 BY-SA版权

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

import tensorflow as tf

import numpy as np

na = np.arange(12).reshape(3,4)

ta= tf.convert_to_tensor(na)

print(type(na))

print(type(ta))

import tensorflow as tf

import numpy as np

a= tf.constant(np.arange(12).reshape(3,4))

print(a)

b=tf.split(a,[2,2],1)#张量存储顺序没有变,维度变换可以

print(b)

import tensorflow as tf

import pandas as pd

import numpy as np

url="http://download.tensorflow.org/data/iris_training.csv"

train_path=tf.keras.utils.get_file(url.split('/')[-1],url)

df_iris = pd.read_csv(train_path)

np.iris = np.array(df_iris)

iris=tf.convert_to_tensor(np.iris)

print(iris.shape)

print(iris[0,:])

print(iris[0:5,:])

二维张量导入和切片

相关知识

TensorFlow学习记录(八)
TensorFlow学习记录(一)
深度学习入门——基于TensorFlow的鸢尾花分类实现(TensorFlow
TensorFlow基础学习笔记
Tensorflow 初级教程(一)
Tensorflow:TensorFlow基础(一)
深度学习之基于Tensorflow卷积神经网络花卉识别系统
学习TensorFlow,TensorBoard可视化网络结构和参数
TensorFlow入门
TensorFlow迁移学习的识别花试验

网址: TensorFlow学习记录(一) https://m.huajiangbk.com/newsview2512873.html

所属分类:花卉
上一篇: 人人秀邀请函制作工具丨「三个步骤
下一篇: 华丽写实:《海上花》制作旅程 B