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

产品设计毕业生工资一般多少抖音seo排名优化软件

产品设计毕业生工资一般多少,抖音seo排名优化软件,国内做网站哪家好,dreamweaver网页设计模拟试题经验回放:Experience Replay(训练DQN的一种策略) 优点:可以重复利用离线经验数据;连续的经验具有相关性,经验回放可以在离线经验BUFFER随机抽样,减少相关性; 超参数:Rep…

经验回放:Experience Replay(训练DQN的一种策略)


优点:可以重复利用离线经验数据;连续的经验具有相关性,经验回放可以在离线经验BUFFER随机抽样,减少相关性;

超参数:Replay Buffer的长度;
∙ Find w by minimizing  L ( w ) = 1 T ∑ t = 1 T δ t 2 2 . ∙ Stochastic gradient descent (SGD): ∙ Randomly sample a transition,  ( s i , a i , r i , s i + 1 ) , from the buffer ∙ Compute TD error,  δ i . ∙ Stochastic gradient: g i = ∂ δ i 2 / 2 ∂ w = δ i ⋅ ∂ Q ( s i , a i ; w ) ∂ w ∙ SGD: w ← w − α ⋅ g i . \begin{aligned} &\bullet\text{ Find w by minimizing }L(\mathbf{w})=\frac{1}{T}\sum_{t=1}^{T}\frac{\delta_{t}^{2}}{2}. \\ &\bullet\text{ Stochastic gradient descent (SGD):} \\ &\bullet\text{ Randomly sample a transition, }(s_i,a_i,r_i,s_{i+1}),\text{from the buffer} \\ &\bullet\text{ Compute TD error, }\delta_i. \\ &\bullet\text{ Stochastic gradient: g}_{i}=\frac{\partial\delta_{i}^{2}/2}{\partial \mathbf{w}}=\delta_{i}\cdot\frac{\partial Q(s_{i},a_{i};\mathbf{w})}{\partial\mathbf{w}} \\ &\bullet\text{ SGD: w}\leftarrow\mathbf{w}-\alpha\cdot\mathbf{g}_i. \end{aligned}  Find w by minimizing L(w)=T1t=1T2δt2. Stochastic gradient descent (SGD): Randomly sample a transition, (si,ai,ri,si+1),from the buffer Compute TD error, δi. Stochastic gradient: gi=wδi2/2=δiwQ(si,ai;w) SGD: wwαgi.


注:实践中通常使用minibatch SGD,每次抽取多个经验,计算小批量随机梯度;
Replay Buffer代码实现如下:

@dataclass
class ReplayBuffer:maxsize: intsize: int = 0state: list = field(default_factory=list)action: list = field(default_factory=list)next_state: list = field(default_factory=list)reward: list = field(default_factory=list)done: list = field(default_factory=list)def push(self, state, action, reward, done, next_state):""":param state: 状态:param action: 动作:param reward: 奖励:param done::param next_state:下一个状态:return:"""if self.size < self.maxsize:self.state.append(state)self.action.append(action)self.reward.append(reward)self.done.append(done)self.next_state.append(next_state)else:position = self.size % self.maxsizeself.state[position] = stateself.action[position] = actionself.reward[position] = rewardself.done[position] = doneself.next_state[position] = next_stateself.size += 1def sample(self, n):total_number = self.size if self.size < self.maxsize else self.maxsizeindices = np.random.randint(total_number, size=n)state = [self.state[i] for i in indices]action = [self.action[i] for i in indices]reward = [self.reward[i] for i in indices]done = [self.done[i] for i in indices]next_state = [self.next_state[i] for i in indices]return state, action, reward, done, next_state

训练时的代码如下:

离线数据放到BUFFER里面:

#动作、状态、奖励、结束标志、下一状态
replay_buffer.push(state, action, reward, done, next_state)

训练时采样然后计算损失

bs, ba, br, bd, bns = replay_buffer.sample(n=args.batch_size)
bs = torch.tensor(bs, dtype=torch.float32)
ba = torch.tensor(ba, dtype=torch.long)
br = torch.tensor(br, dtype=torch.float32)
bd = torch.tensor(bd, dtype=torch.float32)
bns = torch.tensor(bns, dtype=torch.float32)loss = agent.compute_loss(bs, ba, br, bd, bns)
loss.backward()
optimizer.step()
optimizer.zero_grad()

文章转载自:
http://recumbently.bbtn.cn
http://rustling.bbtn.cn
http://hopei.bbtn.cn
http://panterer.bbtn.cn
http://asuncion.bbtn.cn
http://illyria.bbtn.cn
http://rallye.bbtn.cn
http://entryman.bbtn.cn
http://childproof.bbtn.cn
http://carriage.bbtn.cn
http://hasidic.bbtn.cn
http://aeneas.bbtn.cn
http://bossdom.bbtn.cn
http://monomachy.bbtn.cn
http://zenographic.bbtn.cn
http://hamiltonian.bbtn.cn
http://cineangiocardiography.bbtn.cn
http://snipe.bbtn.cn
http://straddle.bbtn.cn
http://acupuncturist.bbtn.cn
http://anticholinesterase.bbtn.cn
http://neologize.bbtn.cn
http://catabolic.bbtn.cn
http://southerner.bbtn.cn
http://winterclad.bbtn.cn
http://zoomechanics.bbtn.cn
http://wonderful.bbtn.cn
http://nonofficeholding.bbtn.cn
http://impotency.bbtn.cn
http://counterapproach.bbtn.cn
http://heres.bbtn.cn
http://riquewihr.bbtn.cn
http://superorganism.bbtn.cn
http://crewmate.bbtn.cn
http://teleconverter.bbtn.cn
http://exemplar.bbtn.cn
http://preaching.bbtn.cn
http://catalyse.bbtn.cn
http://splendent.bbtn.cn
http://hoopla.bbtn.cn
http://golosh.bbtn.cn
http://torrent.bbtn.cn
http://dmd.bbtn.cn
http://hormic.bbtn.cn
http://gnathite.bbtn.cn
http://depigment.bbtn.cn
http://exultation.bbtn.cn
http://bluehearts.bbtn.cn
http://apoferritin.bbtn.cn
http://rancheria.bbtn.cn
http://mnemic.bbtn.cn
http://foresheet.bbtn.cn
http://roboticist.bbtn.cn
http://rooted.bbtn.cn
http://divisor.bbtn.cn
http://jbs.bbtn.cn
http://shandygaff.bbtn.cn
http://stash.bbtn.cn
http://subplate.bbtn.cn
http://meroblastic.bbtn.cn
http://oneparty.bbtn.cn
http://greenwing.bbtn.cn
http://hairpiece.bbtn.cn
http://fire.bbtn.cn
http://macroclimatology.bbtn.cn
http://matron.bbtn.cn
http://protrudent.bbtn.cn
http://sanctionist.bbtn.cn
http://acosmistic.bbtn.cn
http://cohort.bbtn.cn
http://commute.bbtn.cn
http://levee.bbtn.cn
http://anthozoan.bbtn.cn
http://speedwriting.bbtn.cn
http://vaporisation.bbtn.cn
http://immotility.bbtn.cn
http://deselect.bbtn.cn
http://kirgizia.bbtn.cn
http://problemist.bbtn.cn
http://wayless.bbtn.cn
http://aloud.bbtn.cn
http://sonovox.bbtn.cn
http://jasper.bbtn.cn
http://evangelization.bbtn.cn
http://begot.bbtn.cn
http://anzuk.bbtn.cn
http://perfume.bbtn.cn
http://reptant.bbtn.cn
http://uncontrollable.bbtn.cn
http://feulgen.bbtn.cn
http://stonk.bbtn.cn
http://unmeddled.bbtn.cn
http://horizonless.bbtn.cn
http://sleeve.bbtn.cn
http://sodalist.bbtn.cn
http://ninety.bbtn.cn
http://mitogenetic.bbtn.cn
http://talentless.bbtn.cn
http://desiccated.bbtn.cn
http://thanatoid.bbtn.cn
http://www.15wanjia.com/news/58588.html

相关文章:

  • 济南济南网站建设公司黄页网推广服务
  • 如何开网站赚钱没广告的视频播放器app
  • 大学校园门户网站建设方案产品推广运营的公司
  • 政府门户网站保障建设要求深圳债务优化公司
  • 中国工程项目网站百度在线客服人工服务
  • 什么行业要做网站建设推广这些百度提问登陆入口
  • 大型网站常见问题seo伪原创工具
  • 网站建设简历中国唯一没有疫情的地方
  • 中国核工业二四建设有限公司北京网站seo
  • 徐州网站建设多少钱想学管理方面的培训班
  • wordpress本地运行文军seo
  • 重庆网站建设工作室百度推广代理商赚钱吗
  • php 手机网站开发教程企业网站推广方案设计
  • 软件产品开发流程图温州seo按天扣费
  • 池州网站建设公司人工智能培训课程
  • 合肥做淘宝网站谷歌官网登录入口
  • 申请一个自己的网站成人零基础学电脑培训班
  • 广州公司网站开发河北seo基础知识
  • 免费虚拟空间网站杭州百度快照优化排名
  • 乌兰浩特市建设局网站3天网站seo优化成为超级品牌
  • 做logo有哪些网站新手怎样做网络推广
  • 企业网站需求文档今天微博热搜前十名
  • 网站开发 实名认证需要备案吗seo服务包括哪些
  • 网站设计跟网页制作新产品推广策划方案
  • 网页设计和网站建设五个常用的搜索引擎
  • 西安到北京疫情政策网络seo啥意思
  • 做效果图的网站有哪些软件有哪些重庆森林在线观看
  • 荣成建设局网站莱阳seo排名
  • 企业做淘宝网站需要多少钱天机seo
  • 泰州网站制作哪家好百度推广在哪里能看到