SARSA算法

机器学习数据挖掘
范式
问题
  • 因素分析
  • CCA
  • ICA
  • LDA
  • NMF英语Non-negative matrix factorization
  • PCA
  • PGD英语Proper generalized decomposition
  • t-SNE英语t-distributed stochastic neighbor embedding
  • SDL
结构预测英语Structured prediction
  • RANSAC
  • k-NN
  • 局部异常因子英语Local outlier factor
  • 孤立森林英语Isolation forest
  • Q学习
  • SARSA
  • 时序差分(TD)
  • 多智能体英语Multi-agent reinforcement learning
    • Self-play英语Self-play (reinforcement learning technique)
  • RLHF
与人类学习
  • 主动学习英语Active learning (machine learning)
  • 众包
  • Human-in-the-loop英语Human-in-the-loop
模型诊断
  • 学习曲线英语Learning curve (machine learning)
数学基础
  • 内核机器英语Kernel machines
  • 偏差–方差困境英语Bias–variance tradeoff
  • 计算学习理论英语Computational learning theory
  • 经验风险最小化
  • 奥卡姆学习英语Occam learning
  • PAC学习英语Probably approximately correct learning
  • 统计学习
  • VC理论
大会与出版物
  • NeurIPS
  • ICML英语International Conference on Machine Learning
  • ICLR
  • ML英语Machine Learning (journal)
  • JMLR英语Journal of Machine Learning Research
相关条目
  • 人工智能术语英语Glossary of artificial intelligence
  • 机器学习研究数据集列表英语List of datasets for machine-learning research
  • 机器学习概要英语Outline of machine learning

SARSA算法机器学习领域的一种强化学习算法,得名于“状态-动作-奖励-状态-动作”(State–Action–Reward–State–Action)的英文首字母缩写。

SARSA算法最早是由G.A. Rummery, M. Niranjan在1994年提出的,当时称为“改进型联结主义Q学习”(Modified Connectionist Q-Learning)。[1]Richard S. Sutton英语Richard S. Sutton提出了使用替代名SARSA。[2]

SARSA算法和Q学习算法的区别主要在期望奖励Q值的更新方法上。SARSA算法使用五元组(st, at, rt, st+1, at+1)来进行更新,其中s、a、r分别为马可夫决策过程(MDP)中的状态、动作、奖励,t和t+1分别为当前步和下一步。[3]

算法

for each step in episode
 执行动作 
  
    
      
        
          a
          
            t
          
        
      
    
    {\displaystyle a_{t}}
  
,观察奖励 
  
    
      
        
          r
          
            t
          
        
      
    
    {\displaystyle r_{t}}
  
 和下一步状态 
  
    
      
        
          s
          
            t
            +
            1
          
        
      
    
    {\displaystyle s_{t+1}}
  

 基于当前的 
  
    
      
        Q
      
    
    {\displaystyle Q}
  

  
    
      
        
          s
          
            t
            +
            1
          
        
      
    
    {\displaystyle s_{t+1}}
  
,根据特定策略(如ε-greedy)选择 
  
    
      
        
          a
          
            t
            +
            1
          
        
      
    
    {\displaystyle a_{t+1}}
  

 
  
    
      
        
          Q
          
            n
            e
            w
          
        
        (
        
          s
          
            t
          
        
        ,
        
          a
          
            t
          
        
        )
        
        Q
        (
        
          s
          
            t
          
        
        ,
        
          a
          
            t
          
        
        )
        +
        α
        
        [
        
          r
          
            t
          
        
        +
        γ
        
        Q
        (
        
          s
          
            t
            +
            1
          
        
        ,
        
          a
          
            t
            +
            1
          
        
        )
        
        Q
        (
        
          s
          
            t
          
        
        ,
        
          a
          
            t
          
        
        )
        ]
      
    
    {\displaystyle Q^{new}(s_{t},a_{t})\leftarrow Q(s_{t},a_{t})+\alpha \,[r_{t}+\gamma \,Q(s_{t+1},a_{t+1})-Q(s_{t},a_{t})]}
  

 
  
    
      
        
          s
          
            t
          
        
        
        
          s
          
            t
            +
            1
          
        
      
    
    {\displaystyle s_{t}\leftarrow s_{t+1}}
  

  
    
      
        
          a
          
            t
          
        
        
        
          a
          
            t
            +
            1
          
        
      
    
    {\displaystyle a_{t}\leftarrow a_{t+1}}
  

until 状态 
  
    
      
        s
      
    
    {\displaystyle s}
  
 终止

在选择下一步动作 a t + 1 {\displaystyle a_{t+1}} 时,采用ε-greedy策略,即:

  • 以 ε 的概率随机选择下一个动作
  • 以 1-ε 的概率选择可以最大化 Q ( s t + 1 , a t + 1 ) {\displaystyle Q(s_{t+1},a_{t+1})} 的下一个动作

在该算法中,超参数 α {\displaystyle \alpha } 学习速率 γ {\displaystyle \gamma } 为折扣因子。

在更新 Q {\displaystyle Q} 时,对比Q学习使用 max a Q ( s t + 1 , a ) {\displaystyle {\text{max}}_{a}Q(s_{t+1},a)} 作为预估,SARSA则使用 Q ( s t + 1 , a t + 1 ) {\displaystyle Q(s_{t+1},a_{t+1})} 作为预估。[4]一些针对Q学习的提出优化方法也可以应用于SARSA上。[5]

相关条目

参考文献

  1. ^ Online Q-Learning using Connectionist Systems" by Rummery & Niranjan (1994). [2022-07-14]. (原始内容存档于2013-06-08). 
  2. ^ Jeevanandam, Nivash. Underrated But Fascinating ML Concepts #5 – CST, PBWM, SARSA, & Sammon Mapping. Analytics India Magazine. 2021-09-13 [2021-12-05]. (原始内容存档于2021-12-05) (英语). 
  3. ^ Richard S. Sutton and Andrew G. Barto. Sarsa: On-Policy TD Control. Reinforcement Learning: An Introduction. [2022-07-14]. (原始内容存档于2020-07-05). 
  4. ^ TINGWU WANG. Tutorial of Reinforcement: A Special Focus on Q-Learning (PDF). cs.toronto. [2022-07-14]. (原始内容存档 (PDF)于2022-07-14). 
  5. ^ Wiering, Marco; Schmidhuber, Jürgen. Fast Online Q(λ) (PDF). Machine Learning. 1998-10-01, 33 (1): 105–115 [2022-07-14]. ISSN 0885-6125. S2CID 8358530. doi:10.1023/A:1007562800292可免费查阅. (原始内容存档 (PDF)于2018-10-30) (英语). 
可微分计算
概论
概念
应用
硬件
  • TPU
  • VPU
  • IPU英语Graphcore
  • 憶阻器
  • SpiNNaker英语SpiNNaker
软件库
实现
视觉·语音
自然语言
决策
人物
组织
架构
  • 主题 主题
    • 计算机编程
    • 技术
  • 分类 分类
    • 人工神经网络
    • 机器学习