当前位置:网站首页>TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
2022-08-11 06:45:00 【phac123】
Numpy和Tensor格式都可以用这个语句读入数据
data = tf.data.Dataset.from_tensor_slices((输入特征, 标签))
代码
import tensorflow as tf
features = tf.constant([12, 23, 10, 17])
labels = tf.constant([0, 1, 1, 0])
dataset = tf.data.Dataset.from_tensor_slices((features, labels))
print(dataset)
for element in dataset:
print(element)
边栏推荐
- concept noun
- Douyin share password url API tool
- Pytorch模型转ONNX模型
- Discourse 的关闭主题(Close Topic )和重新开放主题
- Pinduoduo api interface application example
- Production and optimization of Unity game leaderboards
- Unity3D 学习路线?
- 2022-08-09 Group 4 Self-cultivation class study notes (every day)
- Discourse's Close Topic and Reopen Topic
- 如何选择专业、安全、高性能的远程控制软件
猜你喜欢
随机推荐
关于Android Service服务的面试题
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
unable to extend table xxx by 1024 in tablespace xxxx
2022-08-09 Group 4 Self-cultivation class study notes (every day)
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
LeetCode brushing series -- 46. Full arrangement
matplotlib
Multiscale communication in cortical-cortical networks
daily sql - query for managers and elections with at least 5 subordinates
Service的两种状态形式
linux 安装mysql服务报错
【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
Redis测试
Douyin get douyin share password url API return value description
Get Pinduoduo product information operation details
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
详述MIMIC 的ICU患者检测时间信息表(十六)
How Unity handles C# under the hood
SQL sliding window
LeetCode刷题系列 -- 46. 全排列