深度学习入门(9) - Reinforcement Learning 强化学习

Reinforcement Learning

an agent performs actions in environment, and receives rewards

goal: Learn how to take actions that maximize reward

Stochasticity: Rewards and state transitions may be random

Credit assignment : Reward r t r_t rt may not directly depend on action a t a_t at

Nondifferentiable: Can't backprop through the world

Nonstationary: What the agent experiences depends on how it acts

Markov Decision Process (MDP)

Mathematical formalization of the RL problem: A tuple ( S , A , R , P , γ ) (S,A,R,P,\gamma) (S,A,R,P,γ)

S S S: Set of possible states

A A A: Set of possible actions

R R R: Distribution of reward given (state, action) pair

P P P: Transition probability: distribution over next state given (state, action)

γ \gamma γ: Discount factor (trade-off between future and present rewards)

Markov Property: The current state completely characterizes the state of the world. Rewards and next states depend only on current state, not history.

Agent executes a policy π \pi π giving distribution of actions conditioned on states.

Goal : Find best policy that maximizes cumulative discounted reward ∑ t γ t r t \sum_t \gamma^tr_t ∑tγtrt

We will try to find the maximal expected sum of rewards to reduce the randomness.

Value function V π ( s ) V^{\pi}(s) Vπ(s): expected cumulative reward from following policy π \pi π from state s s s

Q function Q π ( s , a ) Q^{ \pi}(s,a) Qπ(s,a) : expected cumulative reward from following policy π \pi π from taking action a a a in state s s s

Bellman Equation

After taking action a in state s, we get reward r and move to a new state s'. After that, the max possible reward we can get is max ⁡ a ′ Q ∗ ( s ′ , a ′ ) \max_{a'} Q^*(s',a') maxa′Q∗(s′,a′)

Idea: find a function that satisfy Bellman equation then it must be optimal

start with a random Q, and use Bellman equation as an update rule.

But if the state is large/infinite, we can't iterate them.

Approximate Q(s, a) with a neural network, use Bellman equation as loss function.

-> Deep q learning

Policy Gradients

Train a network π θ ( a , s ) \pi_{\theta}(a,s) πθ(a,s) that takes state as input, gives distribution over which action to take

Objective function: Expected future rewards when following policy π θ \pi_{\theta} πθ

Use gradient ascent -> play some tricks to make it differentiable

Other approaches:

Actor-Critic

Model-Based

Imitation Learning

Inverse Reinforcement Learning

Adversarial Learning

...

Stochastic computation graphs

相关推荐
计算机毕业设计指导几秒前
基于深度学习的车牌识别系统
人工智能·深度学习
九章算科研服务11 分钟前
九章算 JACS 解读-重庆大学黄建峰教授课题组:基于柯肯达尔效应构筑Cu/Ru异质界面空腔结构,用于高效NO3−电还原制NH3
人工智能·科研·dft计算·科研服务·硕博
Hcoco_me18 分钟前
大模型面试题27:Muon优化器小白版速懂
人工智能·rnn·自然语言处理·lstm·word2vec
过期的秋刀鱼!18 分钟前
机器学习-逻辑回归的成本函数
人工智能·机器学习·逻辑回归
haiyu_y18 分钟前
Day 54 Inception 网络及其思考
人工智能·pytorch·深度学习
老吴学AI21 分钟前
第二篇:智能五层模型:定义你的AI应用战略高度
大数据·人工智能·aigc
deephub23 分钟前
从贝叶斯视角解读Transformer的内部几何:mHC的流形约束与大模型训练稳定性
人工智能·深度学习·神经网络·transformer·残差链接
CoderJia程序员甲23 分钟前
2025年度总结之-如何构建 2025 专属的 GitHub AI 项目情报库
人工智能·ai·大模型·github·ai教程
麦德泽特24 分钟前
基于ESP32S3芯片的机器人控制器设计与实现
人工智能·物联网·机器人·esp32·芯片
阿正的梦工坊24 分钟前
VisualTrap:一种针对 GUI Agent 的隐蔽视觉后门攻击
人工智能·深度学习·机器学习·语言模型·自然语言处理