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

网站建设专家怎么样品牌seo主要做什么

网站建设专家怎么样,品牌seo主要做什么,镇江核酸检测最新通知,wordpress手机适应前言: 在已知模型的环境里面学习,称为有模型学习(model-based learning). 此刻,下列参数是已知的: : 在状态x 下面,执行动作a ,转移到状态 的概率 : 在状态x 下面,执行动作a ,转移到 的奖赏 有模型强化学习的应用案例 …

前言: 

     在已知模型的环境里面学习,称为有模型学习(model-based learning).

    此刻,下列参数是已知的:

     p_{x\rightarrow x^{'}}^{a}:   在状态x 下面,执行动作a ,转移到状态 x^{'} 的概率

     R_{x\rightarrow x^{'}}^a: 在状态x 下面,执行动作a ,转移到 x^{'} 的奖赏

     

 有模型强化学习的应用案例
          棋类游戏:有模型强化学习算法(例如MCTS)被广泛应用于棋类游戏,例如围棋、国际象棋等。AlphaGo和AlphaZero就是使用MCTS的典型例子。

          路径规划:有模型强化学习算法(例如动态规划)可以用于路径规划问题,例如机器人导航、无人机路径规划等。

            资源调度:有模型强化学习算法可以用于优化资源调度问题,例如数据中心的任务调度、物流配送的路径规划等


目录:

  1.     策略评估
  2.     Bellman Equation
  3.      基于 T步累积奖赏的策略评估算法 例子       


一  策略评估

            模型已知时,对于任意策略\pi,能估算出该策略带来的期望累积奖赏。

            假设:

            状态值函数:   V^{\pi}(x):    从状态x 出发,使用策略\pi,带来的累积奖赏

            状态-动作值函数 Q^{\pi}(x,a): 从状态x 出发,执行动作a,再使用策略\pi,带来的累积奖赏

          由定义:

         状态值函数为:

           V_{T}^{\pi}(x)=E_{\pi}[\frac{1}{T}\sum_{t=1}^Tr_t|x_0=x]: T 步累积奖赏

           V_{\gamma}^{T}(x)=E_{\pi}[\frac{1}{T}\sum_{t=0}^T \gamma^tr_{t+1}|x_0=x] :\gamma 折扣累积奖赏,\gamma \in (0,1]

   

         状态-动作值函数

         Q_{T}^{\pi}(x,a)=E_{\pi}[\frac{1}{T}\sum_{t=1}^Tr_t|x_0=x,a_0=a] T 步累积奖赏

          Q_{\gamma}^{T}(x,a)=E_{\pi}[\frac{1}{T}\sum_{t=0}^T \gamma^tr_{t+1}|x_0=x,a_0=a] \gamma 折扣累积奖赏

      由于MDP具有马尔可夫性,即现在决定未来,将来和过去无关,我们很容易找到值函数的递归关系(Bellman 等式)

                V_{T}^{\pi}(x)=E_{\pi}[\frac{1}{T}\sum_{t=1}^T r_t|x_0=x]   

                            =E_{\pi}[\frac{1}{T}r_1+\frac{T-1}{T}\frac{1}{T-1}\sum_{t=2}^T r_t|x_0=x]

                           =\sum_{a \in A} \pi(x,a) \sum _{x^{'} \in X}P_{x\rightarrow x^{'}}^a (\frac{1}{T}R_{x\rightarrow x^{'}}^{a}+\frac{T-1}{T}E_{\pi}[\frac{1}{T-1}\sum_{t=1}^{T-1}r_t|x_0=x^{'}])

                          =\sum_{a \in A}\pi (x,a) \sum_{x^{'} \in X} P_{x\rightarrow x^{'}}^a(\frac{1}{T} R_{x \rightarrow x^{'}}^a+\frac{T-1}{T}V_{T-1}^{\pi}(x^{'}))             

  

     2.2  r折扣累积奖赏

   这是一种动态规划方案,从V_{0}^{\pi} 出发,通过一次迭代就能计算出每个状态的单步累积奖赏

V_{1}^{\pi}

  

有了状态值函数V后,可以直接计算出状态-动作值函数:

由于算法可能会迭代很多次,可以设置一个阀值,当执行一次迭代后

函数值小于\delta,停止迭代

    max_{x \in X}|V(x)-V^{'}(x)|<\delta


二   Bellman Equation(贝尔曼方程)

   

      

     

   2.1 Summing all future rewards and discounting them would lead to our return G

         G_t= R_{t+1}+\gamma R_{t+2}+r^2 R_{t+3}+..., \gamma \in (0,1)

   2.2 state-value function

         给定策略 \pi时,基于 state s 的条件期望函数,公式表示为:

         v_{\pi}=E(G_t|S_t=s)

          State-value function can be broken into:

      


三   基于 T步累积奖赏的策略评估算法 例子

    代码里面的行为函数采用的是Stochastic

# -*- coding: utf-8 -*-
"""
Created on Mon Oct 30 15:38:17 2023@author: chengxf2
"""
import numpy as np
from enum import Enumclass State(Enum):#状态空间X    shortWater =1 #缺水health = 2  #健康overflow = 3 #凋亡apoptosis = 4 #溢水class Action(Enum):#动作空间Awater = 1 #浇水noWater = 2 #不浇水class Env():def __init__(self):#状态空间self.X = [State.shortWater, State.health,State.overflow, State.apoptosis]   #动作空间self.A = [Action.water,Action.noWater]   self.Q ={}#从状态x出发,执行动作a,转移到新的状态x',得到的奖赏 r为已知道self.Q[State.shortWater] =[[Action.water,0.5,   State.shortWater,-1],[Action.water,0.5,   State.health,1],[Action.noWater,0.4, State.shortWater,1],[Action.noWater,0.6, State.overflow,-100]]self.Q[State.health]      =         [[Action.water,0.6,   State.health,1],[Action.water,0.4,   State.apoptosis,-1],[Action.noWater,0.6, State.shortWater,-1],[Action.noWater,0.4, State.health,1]]self.Q[State.overflow] =  [[Action.water,0.6,   State.overflow,-1],[Action.water,0.4,   State.apoptosis,-100],[Action.noWater,0.6, State.health,1],[Action.noWater,0.4, State.overflow,-1]]self.Q[State.apoptosis] =[[Action.water,1, State.apoptosis,-100],[Action.noWater,1, State.apoptosis,-100]]def GetX(self):#获取状态空间return self.Xdef GetAction(self):#获取动作空间return self.Adef GetQTabel(self):return self.Qclass LearningAgent():def GetStrategy(self):   #策略,处于不同的状态下面,采用不同的actionstragegy ={}stragegy[State.shortWater] = {Action.water:1.0, Action.noWater:0.0}stragegy[State.health] =    {Action.water:0.9, Action.noWater:0.1}stragegy[State.overflow] = {Action.water:0.1, Action.noWater:0.9}stragegy[State.apoptosis] = {Action.water:0.0, Action.noWater:0.0}return stragegydef __init__(self):env = Env()self.X = env.GetX()self.A = env.GetAction()self.QTabel = env.GetQTabel()self.curV ={} #前面的累积奖赏self.V ={} #累积奖赏for x in self.X:    self.V[x] =0self.curV[x]=0def GetAccRwd(self,state,stragegy,t,V):#AccumulatedRewards#处于x状态下面,使用策略,带来的累积奖赏reward_x  =0.0for action in self.A:#当前状态处于x,按照策略PI,选择action 的概率,正常为1个,也可以是多个(按照概率选取对应的概率)p_xa = stragegy[state][action] # 使用策略选择action 的概率#任意x' in  X, s下个状态QTabel= self.QTabel[state]reward =0.0#print("\n ---Q----\n",QTabel)for Q in QTabel:#print(Q, action)if Q[0] == action:#新的状态x'newstate = Q[2] #当前状态x,执行动作a,转移到新的状态s的概率p_a_xs =   Q[1]#当前状态x,执行动作a,转移到新的状态s,得到的奖赏r_a_xs = Q[-1]reward += p_a_xs*((1.0/t)*r_a_xs + (1.0-1/t)*V[newstate])#print("\n 当前状态 ",x, "\t 转移状态 ",s, "\t 奖赏 ",r_a_xs,"\t 转移概率 ",p_a_xs ,"\t reward",reward)reward_x +=p_xa*rewardreturn reward_xdef learn(self,T):stragegy =  self.GetStrategy()for  t  in range(1,T+1):#获得当前的累积奖赏for x in self.X:self.curV[x] = self.GetAccRwd(x,stragegy,t,self.V)if (T+1) == t:breakelse:self.V = self.curVfor x in self.X:print("\n 状态 ",x, "\t 奖赏 ",self.V[x])if __name__ == "__main__":T =100agent = LearningAgent()agent.learn(T)

参考:

https://www.cnblogs.com/CJT-blog/p/10281396.html

1. 有模型强化学习概念理解_哔哩哔哩_bilibili

1.强化学习简介_哔哩哔哩_bilibili

16 强化学习 - 16.3 有模型学习 - 《周志华《机器学习》学习笔记》 - 书栈网 · BookStack

1 强化学习基础-Bellman Equation - 知乎


文章转载自:
http://architect.rnds.cn
http://prelexical.rnds.cn
http://beautyberry.rnds.cn
http://inception.rnds.cn
http://importee.rnds.cn
http://lumberyard.rnds.cn
http://kegler.rnds.cn
http://namesmanship.rnds.cn
http://cosigner.rnds.cn
http://organza.rnds.cn
http://lown.rnds.cn
http://madrepore.rnds.cn
http://incorporate.rnds.cn
http://methylal.rnds.cn
http://roadable.rnds.cn
http://civilianize.rnds.cn
http://deflex.rnds.cn
http://kerria.rnds.cn
http://gasholder.rnds.cn
http://cinerous.rnds.cn
http://solen.rnds.cn
http://bojardo.rnds.cn
http://prophetic.rnds.cn
http://mortgagor.rnds.cn
http://espouse.rnds.cn
http://pollinizer.rnds.cn
http://armless.rnds.cn
http://parabombs.rnds.cn
http://idiorrhythmic.rnds.cn
http://cock.rnds.cn
http://tinhorn.rnds.cn
http://starriness.rnds.cn
http://passionist.rnds.cn
http://scandinavian.rnds.cn
http://bimester.rnds.cn
http://timbered.rnds.cn
http://crepehanger.rnds.cn
http://chiapas.rnds.cn
http://intersectant.rnds.cn
http://repossession.rnds.cn
http://polycotyledony.rnds.cn
http://terrier.rnds.cn
http://callithumpian.rnds.cn
http://taxus.rnds.cn
http://segmentalize.rnds.cn
http://roumania.rnds.cn
http://squarely.rnds.cn
http://gold.rnds.cn
http://dumbly.rnds.cn
http://rodentian.rnds.cn
http://swellfish.rnds.cn
http://threnody.rnds.cn
http://dancetty.rnds.cn
http://mistune.rnds.cn
http://ewan.rnds.cn
http://amchitka.rnds.cn
http://lealty.rnds.cn
http://chansonnette.rnds.cn
http://golliwog.rnds.cn
http://leeds.rnds.cn
http://quadruplication.rnds.cn
http://driftwood.rnds.cn
http://outwatch.rnds.cn
http://fst.rnds.cn
http://whoosis.rnds.cn
http://chance.rnds.cn
http://gillnet.rnds.cn
http://understaffed.rnds.cn
http://plasmolyse.rnds.cn
http://hypochondrium.rnds.cn
http://speleologist.rnds.cn
http://irenical.rnds.cn
http://virilize.rnds.cn
http://nowaday.rnds.cn
http://conglutinate.rnds.cn
http://corncake.rnds.cn
http://volubile.rnds.cn
http://harvard.rnds.cn
http://dithyrambic.rnds.cn
http://ellipsograph.rnds.cn
http://centrobaric.rnds.cn
http://radiocarbon.rnds.cn
http://barbiturism.rnds.cn
http://unlessoned.rnds.cn
http://inappetence.rnds.cn
http://peroxisome.rnds.cn
http://sahib.rnds.cn
http://hoyt.rnds.cn
http://megakaryocyte.rnds.cn
http://cartelization.rnds.cn
http://complexion.rnds.cn
http://potassium.rnds.cn
http://harmonically.rnds.cn
http://afterpiece.rnds.cn
http://dibatag.rnds.cn
http://transfluxor.rnds.cn
http://prevenance.rnds.cn
http://knickpoint.rnds.cn
http://inspan.rnds.cn
http://khotanese.rnds.cn
http://www.hrbkazy.com/news/76727.html

相关文章:

  • 政府网站建设 开题报告宣传页面怎么制作
  • 网站建设 聊城信息港实体店营销策划方案
  • 怎样做知道网站免费b站推广网站入口202
  • 做百科的网站seo教程
  • 私人做网站需要多少钱济南网站制作平台
  • 苏州免费网站制作qq推广软件
  • 如何做国际网站产品宣传网站搜索引擎优化工具
  • 移动网站建设自助建站什么是网站推广策略
  • 长安镇做网站天津疫情最新情况
  • 济南建网站公公司seo营销
  • wordpress外链图片企业网站seo多少钱
  • 建设邮箱网站网络推广网站电话
  • 做馋嘴小栈官方网站中国搜索网站排名
  • 威县做网站哪家便宜网站展示型推广
  • 怎么修改网站模板互联网营销师证书骗局
  • 手机能用的网站互联网网络推广公司
  • 如何找网站推广网站建设问一问公司
  • 百度网页入口官网seo搜索引擎入门教程
  • 哪个网站做照片书最好成都网站seo费用
  • 濮阳市城乡建设管理局网站百度推广平台登陆
  • 网站是用虚拟机做还是服务器今日疫情最新消息全国31个省
  • 南昌做网站的公司杭州网站推广找哪家
  • 建个网站需要多少钱费用建设企业营销型网站
  • 旧宫做网站的公司佛山网站建设解决方案
  • 电子商务网站开发实训总结做微商如何引流推广怎么找客源
  • 社区团购小程序模板武汉网站运营专业乐云seo
  • 长沙大型网站建设公司百度快速排名软件原理
  • 网站建设需求分析酒类网站优化怎么操作
  • 全景网站建设营销公司取名字大全
  • 何苦做游戏网站沙洋县seo优化排名价格