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

手机怎么安装网站程序标识设计图片

手机怎么安装网站程序,标识设计图片,商业网站建设与维护方案书,北京平台网站建设多少钱本笔记记录tf.where进行元素位置查找#xff0c;scatter_nd用于指派元素到tensor的特定位置#xff0c;meshgrid用作绘图的相关操作。 import tensorflow as tf import numpy as np import matplotlib.pyplot as plttf.__version__#where操作查找元素位置 #输入的tensor是Tr…        本笔记记录tf.where进行元素位置查找scatter_nd用于指派元素到tensor的特定位置meshgrid用作绘图的相关操作。 import tensorflow as tf import numpy as np import matplotlib.pyplot as plttf.__version__#where操作查找元素位置 #输入的tensor是True,False组成的tensor tensor tf.random.uniform([3,3], minval-12, maxval12, dtypetf.int32) print(tensor.numpy())#获得大于0的值的mask mask tensor 0 print(mask) #方式1通过boolean_mask获得大于0的元素的值 print(tf.boolean_mask(tensor, mask):\n, tf.boolean_mask(tensor, mask).numpy()) #方式2先通过where查询到大于0的元素位置然后用gather_nd收集 indices tf.where(mask) print(indices for the ones greater than 0:\n, indices.numpy()) print(tf.gather_nd(tensor, indices):\n, tf.gather_nd(tensor, indices))#where带条件选择元素 #where(cond, tensor1, tensor2) #传入cond如果cond对应位置为True会收集tensor1对应位置的元素否则收集tensor2对应位置的元素 tensor1 tf.random.uniform([3,3], minval-12, maxval12, dtypetf.int32) tensor2 tf.random.uniform([3,3], minval-12, maxval12, dtypetf.int32) print(tensor1) print(tensor2)cond tensor1 0 print(Condition:\n, cond) print(where(cond, tensor1, tensor2):\n, tf.where(cond, tensor1, tensor2))#scatter_nd将元素放到对应位置其他值为0 #scatter_nd(indices, updates, shape) #indices指定要更新到的位置 #updates指定更新的值 #shape表示tensor的形状#1维tensor的例子 indices tf.constant([[4], [3], [1], [9]]) updates tf.constant([6, 7, 8, 9]) shape tf.constant([10])print(tf.scatter_nd(indices, updates, shape):\n, tf.scatter_nd(indices, updates, shape))#多维tensor的scatrer_nd # shape为5x4x4 #将值更新到大维度的0和2处实际对应一个4x4的tensor indices tf.constant([[0], [2], [4]]) updates tf.constant([[[1, 1, 1, 1],[1, 1, 1, 1],[1, 1, 1, 1],[1, 1, 1, 1],],[[2, 2, 2, 2],[2, 2, 2, 2],[2, 2, 2, 2],[2, 2, 2, 2],],[[3, 3, 3, 3],[3, 3, 3, 3],[3, 3, 3, 3],[3, 3, 3, 3],]]) shape tf.constant([5,4,4]) print(tf.scatter_nd(indices, updates, shape):\n, tf.scatter_nd(indices, updates, shape))#meshgrid绘图 #1. 设置x和y的linspace y tf.linspace(-2., 2, 5) x tf.linspace(-2., 2, 5)#获得坐标点tensor xPoints, yPoints tf.meshgrid(x, y) print(X points:\n, xPoints) print(Y points:\n, yPoints) #通过tf.stack获得点的xy集合 points tf.stack([xPoints, yPoints], axis2) print(Collection of XY points on plane:\n, points)#meshgrid实例,z sin(x) sin(y) x tf.linspace(0., 2 * 3.14, 500) y tf.linspace(0., 2 * 3.14, 500) xPoints, yPoints tf.meshgrid(x, y) points tf.stack([xPoints, yPoints], axis2)z tf.math.sin(points[..., 0]) tf.math.sin(points[..., 1]) #绘制z的值 plt.figure(z sin(x) sin(y)) plt.imshow(z, originlower, interpolationnone) plt.colorbar()#绘制等高线 plt.figure(plot contour) plt.contour(xPoints, yPoints, z) plt.colorbar() plt.show()运行结果
http://www.pierceye.com/news/813366/

相关文章:

  • 旅游电网站建设目标公司注册成本
  • 建设婚恋网站基本功能有哪些毕业设计网页
  • 广州贸易网站杭州关键词推广优化方案
  • 怎么注册自己的网站wordpress静态设置
  • 网站收录有什么好处仿糗事百科wordpress
  • 面试网站建设工程师鞍山市城市建设管理局网站
  • 电商网站建设与管理柳州网站建设多少钱
  • 网站的访问量统计怎么做企业网站建设基本标准
  • 网站开发服务属于什么行业先做网站再备案吗
  • 做零售去哪个外贸网站专业做网站较好的公司
  • 网站运营职业分析2233网页游戏大全
  • 深圳网站制作880网站建设课设总结
  • 瑶海区网站建设公司中铁建设集团有限公司基础设施事业部
  • wordpress 用js网站备案 seo
  • 网站一级域名和二级域名区别自己怎么做外贸英文网站
  • 南京网站定制南京wordpress安装提示500错误
  • 网站图片优化免费网站建设凡科
  • 网站开发项目团队网页设计图片与文字的研究
  • 百度网站建设策划书范文做暧在线网站
  • 松江新城做网站公司国产成年做视频网站
  • 杭州网站推广服务网站单页面怎么做
  • 房地产网站建设案例wordpress 判断移动端
  • 网站开发过程文档网站代码需要注意什么问题
  • 怎么选一个适合自己的网站wordpress怎么修改后台登录地址
  • 网页制作与网站建设自考西安千秋网络科技有限公司
  • 建设网站的费用入什么科目永久免费google搜索引擎
  • 拍卖网站怎么做梧州网页设计师招聘
  • 炫酷网站源码下载网站建设副业
  • 做dw和ps的网站教学做网站属于什么费用
  • 秦皇岛网站制作小程序开发wordpress调用分类标签