当前位置: 首页 > wzjs >正文

我的世界电影怎么做的视频网站百度收录刷排名

我的世界电影怎么做的视频网站,百度收录刷排名,营销网站建设公司推荐,合肥市人民政府外事办公室目录 前言示例示例1示例2示例3示例4 前言 TensorFlow 的 tf.data.Dataset API 提供了一种灵活且高效的方式来加载和预处理数据。它可以轻松处理大规模数据集,并支持多种数据源格式。 所有数据集相关的内容都在tf.data中,from_tensor_slices:…

目录

  • 前言
  • 示例
    • 示例1
    • 示例2
    • 示例3
    • 示例4

前言

TensorFlow 的 tf.data.Dataset API 提供了一种灵活且高效的方式来加载和预处理数据。它可以轻松处理大规模数据集,并支持多种数据源格式。 所有数据集相关的内容都在tf.data中,from_tensor_slices:可以从元组, 列表, 字典, ndarray中创建dataset。

示例

示例1

import tensorflow as tf
import numpy as npdataset = tf.data.Dataset.from_tensor_slices(np.arange(10))  
print (dataset)# 数据集最基础的用法就是取数据
for item in dataset:print(item)

结果如下:

<TensorSliceDataset shapes: (), types: tf.int32>
tf.Tensor(0, shape=(), dtype=int32)
tf.Tensor(1, shape=(), dtype=int32)
tf.Tensor(2, shape=(), dtype=int32)
tf.Tensor(3, shape=(), dtype=int32)
tf.Tensor(4, shape=(), dtype=int32)
tf.Tensor(5, shape=(), dtype=int32)
tf.Tensor(6, shape=(), dtype=int32)
tf.Tensor(7, shape=(), dtype=int32)
tf.Tensor(8, shape=(), dtype=int32)
tf.Tensor(9, shape=(), dtype=int32)

示例2

import tensorflow as tf
import numpy as np# 从元组创建dataset, (x,y)
x = np.array([[1, 2], [3, 4], [5, 6]])
y = np.array(['cat', 'dog', 'fox'])
dataset = tf.data.Dataset.from_tensor_slices((x, y))
for item_x, item_y in dataset:print(item_x.numpy(), item_y.numpy().decode())

结果如下

[1 2] b'cat'
[3 4] b'dog'
[5 6] b'fox'

示例3

import tensorflow as tf
import numpy as np# 从元组创建dataset, (x,y)
x = np.array([[1, 2], [3, 4], [5, 6]])
y = np.array(['cat', 'dog', 'fox'])
dataset = tf.data.Dataset.from_tensor_slices({'feature': x,'label': y
})
for item in dataset:print(item['feature'].numpy(), item['label'].numpy())

结果如下

[1 2] b'cat'
[3 4] b'dog'
[5 6] b'fox'

示例4

import tensorflow as tf
import numpy as np# interleave
# 最常见用法 : 文件名dataset  --> 具体数据集
dataset = tf.data.Dataset.from_tensor_slices(np.arange(10))
dataset = dataset.repeat(3).batch(7)
# map_fn, cycle_length 并行长度, block_length 
dataset = dataset.interleave(lambda v: tf.data.Dataset.from_tensor_slices(v),cycle_length = 5,block_length = 5
)
for item in dataset:print(item)

结果如下

tf.Tensor(0, shape=(), dtype=int32)
tf.Tensor(1, shape=(), dtype=int32)
tf.Tensor(2, shape=(), dtype=int32)
tf.Tensor(3, shape=(), dtype=int32)
tf.Tensor(4, shape=(), dtype=int32)
tf.Tensor(7, shape=(), dtype=int32)
tf.Tensor(8, shape=(), dtype=int32)
tf.Tensor(9, shape=(), dtype=int32)
tf.Tensor(0, shape=(), dtype=int32)
tf.Tensor(1, shape=(), dtype=int32)
tf.Tensor(4, shape=(), dtype=int32)
tf.Tensor(5, shape=(), dtype=int32)
tf.Tensor(6, shape=(), dtype=int32)
tf.Tensor(7, shape=(), dtype=int32)
tf.Tensor(8, shape=(), dtype=int32)
tf.Tensor(1, shape=(), dtype=int32)
tf.Tensor(2, shape=(), dtype=int32)
tf.Tensor(3, shape=(), dtype=int32)
tf.Tensor(4, shape=(), dtype=int32)
tf.Tensor(5, shape=(), dtype=int32)
tf.Tensor(8, shape=(), dtype=int32)
tf.Tensor(9, shape=(), dtype=int32)
tf.Tensor(5, shape=(), dtype=int32)
tf.Tensor(6, shape=(), dtype=int32)
tf.Tensor(2, shape=(), dtype=int32)
tf.Tensor(3, shape=(), dtype=int32)
tf.Tensor(9, shape=(), dtype=int32)
tf.Tensor(0, shape=(), dtype=int32)
tf.Tensor(6, shape=(), dtype=int32)
tf.Tensor(7, shape=(), dtype=int32)
http://www.dtcms.com/wzjs/511769.html

相关文章:

  • 苏州高端网站建设定制百度指数官网查询
  • 做墙绘一般在哪个网站最新网络营销方式
  • 沈阳网页设计收费标准seo网站优化系统
  • 临沂网站设计价格seo博客模板
  • 做网站app是什么h行业百度营销平台
  • 哪个网站注册域名seo搜索优化培训
  • 全国知名网站排名进入百度网首页
  • 博客网络营销方式seo排名点击软件推荐
  • 无忧网站源码seo人工智能
  • 做app网站有哪些功能app开发教程
  • 做私人彩票网站网络营销软文范文
  • 杭州有做网站免费手机网站建站系统
  • 动态网站难不难做网络营销的职能有哪些
  • 常州建设银行网站首页最新注册域名查询
  • 网站平台建设思路百度精准获客平台
  • 2018建设一个网站需要什么长尾关键词挖掘工具爱网站
  • 网站建设 发展方向广东seo网站推广
  • 网站 页面风格 建设天津seo招聘
  • 公司请外包做的网站怎么维护crm软件
  • 签到做任务赚钱的网站怎样做自己的网站
  • 用dede.com网站上传文件购买seo关键词排名优化官网
  • 邯郸做网站公司百度精简版网页入口
  • 怎么给网站做第三方app网络推广企业
  • wordpress 资讯类模板东莞seo报价
  • 德州口碑好的网站制作公司清理大师
  • 做旅游的网站品牌营销包括哪些方面
  • 北京做商铺的网站大型网站制作
  • 洛阳做网站公司电话品牌词优化
  • 柳州网站建设工作室seo 页面
  • 网站竞争对手如何做调研小广告怎么能弄干净