《Reinforcement Learning》 读书笔记 2:多臂老虎机(Multi-armed Bandits)

版权声明:本文为博主原创文章,欢迎交流分享,未经博主允许不得转载。 https://blog.csdn.net/qjf42/article/details/79655483
《Reinforcement Learning: An Introduction》 读书笔记 - 目录

Reinforcement Learning 和 Supervised Learning 的区别

evaluate vs instruct

  • 也就是说,RL的对于每一个action的效果不是非黑即白的,而是在每一次的action之后都可能不一样的后果(feedback, reward)
    • 非iid,基于不同环境 和/或 之前的 actions
    • reward可能是随机的

定义问题( k-armed bandit problem)

  • k种actions => k个reward R 的平稳分布
  • 目标
    • m a x   E ( R t )

一些概念

exploitation vs exploration (EE)

  • exploitation: greedy move
  • exploration: nongreedy trial

reward & value

the value of an action a , denoted q ( a ) , is the expected reward given that a

  • i.e. q ( a ) = E [ R t | A t = a ]
  • 用经验分布近似估计:
    • Q t ( a ) = i = 1 t 1 R i 1 A i = a i = 1 t 1 1 A i = a
    • 迭代式(在执行某个 a 后):
      Q t ( a ) = Q t 1 + 1 t ( R t ( a ) Q t 1 ) = Q t 1 + α ( t ) ( R t ( a ) Q t 1 )
  • 更广义的, N e w = O l d + S t e p S i z e ( T a r g e t O l d )
    • 这里,StepSize可以是单调减的,常数(指数平滑), …

几种方法

ε -greedy

  • 算法
    • p = 1 ε 执行greedy action (exploitation)
    • p = ε 执行nongreedy action (exploration)
  • 优点
    • 实现简单
    • 效果不会太差,即使分布是非平稳的
  • 缺点
    • 通常收敛比较慢
    • 单纯的 ε -greedy收敛后执行最优action(greedy)的比例为 1 ε < 1
  • 优化点
    • ε 随时间减小
    • 选一个大点的 Q 0 ( a )
      • encourage exploration,选择足够大,能保证state space都覆盖到
      • 即使非平稳也没问题,因为影响只是暂时的

UCB(Upper-Confidence-Bound)

  • 算法
    • A t = a r g m a x a (   Q t ( a ) + c l n ( t ) / ( N t ( a ) + ϵ )   )
    • ϵ 0 或1
    • c 是平衡EE的参数(类比置信度)
  • 缺点
    • 适用范围没有 ε -greedy广,比如非平稳分布

Gradient Bandit

  • 算法
    • 定义
      • H t ( a ) 为preference for action a
      • π t ( a ) = P t ( A t = a ) = s o f t m a x t ( H t ( a ) ) 非argmax
    • 迭代
      • H t + 1 ( A t ) = H t ( A t ) + α ( R t R ¯ t ) ( 1 π t ( A t ) )
      • H t + 1 ( a ) = H t ( a ) α ( R t R ¯ t ) π t ( a ) ,  for all  a A t
    • 推导
      • E ( R t ) = x π t ( x ) q ( x )
      • H t + 1 ( a ) = H t ( a ) + α E ( R t ) H t ( a ) =
  • 优点
    • 通用思想,可以引申到后面的full RL问题中

其它

Bayesian methods(posterior sampling/Thompson sampling)

  • 假设value服从某个(未知的)稳定分布 f
  • 假设一个(确定的)先验分布 f p r i ,执行一系列action,根据结果,得到后验分布 f p o s t (收敛于 f
  • e.g
    图片

如何比较(参数&算法)

  • learning curve
    • x轴为参数,y轴为average sum of rewards (e.g of 1000 experiments)
      图片

其他点

associative search (contextual bandits)


  • 就是包含不同situation (environment)的问题(但与former actions仍无关)

If actions are allowed to affect the next situation as well as the reward, then we have the full reinforcement learning problem.

猜你喜欢

转载自blog.csdn.net/qjf42/article/details/79655483