当前位置:网站首页>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)
边栏推荐
- Redis + lua implements distributed interface current limiting implementation scheme
- 2022-08-10 第四小组 修身课 学习笔记(every day)
- 每日sql-员工奖金过滤和回答率排序第一
- 1688 product interface
- How to choose professional, safe and high-performance remote control software
- prometheus学习5altermanager
- daily sql - query for managers and elections with at least 5 subordinates
- 微信小程序功能上新(2022.06.01~2022.08.04)
- Find the shops that have sold more than 1,000 yuan per day for more than 30 consecutive days in the past six months
- sql--Users who have purchased more than 3 times (inclusive) within 7 days (including the current day), and the purchase amount in the past 7 days exceeds 1,000
猜你喜欢
随机推荐
《猪猪1984》NFT 作品集将上线 The Sandbox 市场平台
How to choose professional, safe and high-performance remote control software
联想集团:2022/23财年第一季度业绩
STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比
Strongly recommend an easy-to-use API interface
Douyin API interface
2022-08-09 第四小组 修身课 学习笔记(every day)
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
Internet phone software or consolidation of attack must be "free" calls security clearance
如何选择专业、安全、高性能的远程控制软件
Unity底层是如何处理C#的
How Unity programmers can improve their abilities
3GPP LTE/NR信道模型
pytorch,numpy两种方法实现nms类间+类内
exness:黄金1800关口遇阻,静待美国CPI出炉
你是如何做好Unity项目性能优化的
软件测试基本流程有哪些?北京专业第三方软件检测机构安利
ROS 话题通信理论模型
已解决EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo