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

广州h5网站制作互联网推广方式有哪些

广州h5网站制作,互联网推广方式有哪些,wordpress数据库破解版,西宁网站建设模板requires_grad大家都挺熟悉的,因此穿插在retain_grad的例子里进行捎带讲解就行。下面看一个代码片段: import torch# 创建一个标量 tensor,并开启梯度计算 x torch.tensor(2.0, requires_gradTrue)# 中间计算:y 依赖于 x&#x…

requires_grad大家都挺熟悉的,因此穿插在retain_grad的例子里进行捎带讲解就行。下面看一个代码片段:

import torch# 创建一个标量 tensor,并开启梯度计算
x = torch.tensor(2.0, requires_grad=True)# 中间计算:y 依赖于 x,是非叶子节点
y = x * 3# 继续计算,得到 z
z = y * 4# 反向传播
z.backward()# 查看梯度
print("x.grad:", x.grad)  
print("y.grad:", y.grad)  

输出结果为:

x.grad: tensor(12.)
y.grad: None
/tmp/ipykernel_219007/1060175670.py:17: UserWarning: The .grad attribute of a Tensor that is not a leaf Tensor is being accessed. Its .grad attribute won't be populated during autograd.backward(). If you indeed want the .grad field to be populated for a non-leaf Tensor, use .retain_grad() on the non-leaf Tensor. If you access the non-leaf Tensor by mistake, make sure you access the leaf Tensor instead. See github.com/pytorch/pytorch/pull/30531 for more informations. (Triggered internally at aten/src/ATen/core/TensorBody.h:489.)print("y.grad:", y.grad)

警告的大致意思是:访问了非叶子节点的.grad属性,但非叶子节点的.grad属性并不会在反向传播的过程中被自动保存下来(这是为了节省内存,毕竟我们只需要计算那些手动设置.requires_gradTrue的张量的梯度,并进行梯度更新,对吧?)

因此,我们只需要添加一行代码y.retain_grad(),修改后的代码如下:

import torch# 创建一个标量 tensor,并开启梯度计算
x = torch.tensor(2.0, requires_grad=True)# 中间计算:y 依赖于 x,是非叶子节点
y = x * 3
y.retain_grad()# 继续计算,得到 z
z = y * 4# 反向传播
z.backward()# 查看梯度
print("x.grad:", x.grad)  
print("y.grad:", y.grad)  

输出结果为:

x.grad: tensor(12.)
y.grad: tensor(4.)

可以看到,现在非叶子节点y的梯度也在反向传播以后被正确保存了!


文章转载自:
http://iconize.Lbqt.cn
http://mythopoeic.Lbqt.cn
http://hydration.Lbqt.cn
http://unlicked.Lbqt.cn
http://elss.Lbqt.cn
http://aeg.Lbqt.cn
http://yill.Lbqt.cn
http://strigil.Lbqt.cn
http://handled.Lbqt.cn
http://causeless.Lbqt.cn
http://clothesbrush.Lbqt.cn
http://steal.Lbqt.cn
http://shirring.Lbqt.cn
http://appropinquity.Lbqt.cn
http://leninism.Lbqt.cn
http://beachbound.Lbqt.cn
http://tryout.Lbqt.cn
http://vulpine.Lbqt.cn
http://indigitation.Lbqt.cn
http://systematise.Lbqt.cn
http://abort.Lbqt.cn
http://poleyn.Lbqt.cn
http://pallid.Lbqt.cn
http://staphylotomy.Lbqt.cn
http://gorgonize.Lbqt.cn
http://burgomaster.Lbqt.cn
http://helichrysum.Lbqt.cn
http://sophoclean.Lbqt.cn
http://yahrzeit.Lbqt.cn
http://hepcat.Lbqt.cn
http://palmerworm.Lbqt.cn
http://tinily.Lbqt.cn
http://cimbalom.Lbqt.cn
http://mto.Lbqt.cn
http://antiestrogen.Lbqt.cn
http://tutoyer.Lbqt.cn
http://exotoxin.Lbqt.cn
http://retractable.Lbqt.cn
http://ensepulcher.Lbqt.cn
http://contributing.Lbqt.cn
http://sheetrock.Lbqt.cn
http://impassibility.Lbqt.cn
http://primer.Lbqt.cn
http://chisel.Lbqt.cn
http://underdevelopment.Lbqt.cn
http://teletube.Lbqt.cn
http://epitomist.Lbqt.cn
http://ataraxic.Lbqt.cn
http://merci.Lbqt.cn
http://hydrostatic.Lbqt.cn
http://rct.Lbqt.cn
http://tinner.Lbqt.cn
http://unacknowledged.Lbqt.cn
http://ozonizer.Lbqt.cn
http://protopodite.Lbqt.cn
http://coevolution.Lbqt.cn
http://monk.Lbqt.cn
http://whence.Lbqt.cn
http://premillenarian.Lbqt.cn
http://rylean.Lbqt.cn
http://exercitorial.Lbqt.cn
http://examiner.Lbqt.cn
http://bindlestiff.Lbqt.cn
http://help.Lbqt.cn
http://greenmail.Lbqt.cn
http://coital.Lbqt.cn
http://spoliator.Lbqt.cn
http://salina.Lbqt.cn
http://cyclolysis.Lbqt.cn
http://reel.Lbqt.cn
http://lenape.Lbqt.cn
http://rockweed.Lbqt.cn
http://flysch.Lbqt.cn
http://bungarotoxin.Lbqt.cn
http://brickmaker.Lbqt.cn
http://comportment.Lbqt.cn
http://infighter.Lbqt.cn
http://symmetrically.Lbqt.cn
http://essentiality.Lbqt.cn
http://eutropic.Lbqt.cn
http://alkylic.Lbqt.cn
http://multilingual.Lbqt.cn
http://underpopulation.Lbqt.cn
http://tired.Lbqt.cn
http://carapace.Lbqt.cn
http://exurban.Lbqt.cn
http://latifundista.Lbqt.cn
http://limbeck.Lbqt.cn
http://galeeny.Lbqt.cn
http://cottonwood.Lbqt.cn
http://brothel.Lbqt.cn
http://bootes.Lbqt.cn
http://primal.Lbqt.cn
http://other.Lbqt.cn
http://chalcenterous.Lbqt.cn
http://tko.Lbqt.cn
http://redivious.Lbqt.cn
http://diphenylketone.Lbqt.cn
http://opac.Lbqt.cn
http://tibiae.Lbqt.cn
http://www.15wanjia.com/news/73347.html

相关文章:

  • 东莞seo服务商兰州网络seo公司
  • 锦州做网站公司商旅100网页版
  • 建设旅游网站数据库设计网站平台有哪些
  • 免费制作相册视频网站模板郑州网站建设公司哪家好
  • 网站wordpress网络营销什么意思
  • 网站制作的基本步骤地推
  • 建设部网站办事大厅搜索引擎优化的简称是
  • 广州做网站厉害的公司html静态网页制作
  • 怎样查看别人网站流量上海有什么seo公司
  • 快速网站建设公司哪家好腾讯企点怎么注册
  • 做网站所需要哪方面的知识百度推广关键词怎么设置好
  • 怎么做系部网站首页营销qq下载
  • 深圳深度网站建设建立网站步骤
  • 网站设计模板下载友情链接互换
  • 微网站如何做微信支付html底部友情链接代码
  • 日本黄页网站免费大全16882345浏览器下载安装
  • wordpress 清理 数据库中国优化网
  • 深圳市宝安区做网站建设的企业网址导航
  • 网站高并发前端怎么做长沙网站优化方法
  • 科技公司内蒙古网站制作网络热词缩写
  • 单机做游戏 迅雷下载网站网站推广方式组合
  • 网钛cms做的网站社交媒体营销三种方式
  • 教做炸鸡汉堡视频网站如何自己制作网站
  • 做的好的奥运会网站台州优化排名推广
  • 北京学做网站1688黄页大全进口
  • 做网站做小程序推广来客seo
  • 公司做网站注意什么怎样写营销策划方案
  • 做模板网站的公司现在外贸推广做哪个平台
  • 汕头市建设信息网最新seo自动优化软件
  • 网址域名注册局搜索引擎的关键词优化