作家
登录

深度强化学习入门:用TensorFlow构建你的第一个游戏AI

作者: 来源: 2017-11-21 10:53:27 阅读 我要评论

 learn from randomly 
  •         for i, idx in enumerate(np.random.randint(0, len_memory, 
  •                                                   size=inputs.shape[0])): 
  •             ""
  •             Here we load one transition <s, a, r, s’> from memory 
  •             state_t: initial state s 
  •             action_t: action taken a 
  •             reward_t: reward earned r 
  •             state_tp1: the state that followed s’ 
  •             ""
  •             state_t, action_t, reward_t, state_tp1 = self.memory[idx][0] 
  •              
  •             #We also need to know whether the game ended at this state 
  •             game_over = self.memory[idx][1] 
  •  
  •             #add the state s to the input 
  •             inputs[i:i+1] = state_t 
  •              
  •             # First we fill the target values with the predictions of the model. 
  •             # They will not be affected by training (since the training loss for them is 0) 
  •             targets[i] = model.predict(state_t)[0] 
  •              
  •             ""
  •             If the game ended, the expected reward Q(s,a) should be the final reward r. 
  •             Otherwise the target value 

      推荐阅读

      什么是云计算数据中心?云计算数据中心和传统IDC有何区别?

    Tech Neo技巧沙龙 | 11月25号,九州云/ZStack与您一路商量云时代收集界线治理实践 传统小IDC存活将更难,那么必>>>详细阅读


    本文标题:深度强化学习入门:用TensorFlow构建你的第一个游戏AI

    地址:http://www.17bianji.com/lsqh/39071.html

  • 关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)