深度学习入门(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

相关推荐
CCYe、2 分钟前
企业内训知识助手:怎么搭才不踩坑
人工智能
2601_963282774 分钟前
寒地专网通信实战:对讲机技术选型、组网优化与东北多行业落地全指南
大数据·数据库·人工智能
广凌股份(广凌科技)10 分钟前
广凌智慧大内控一体化平台:告别纸上内控,把握真实运行状态
大数据·人工智能
Zldaisy3d11 分钟前
船舶与海工增材制造市场迎来规范化新阶段!中国船级社新指南9月1日生效
人工智能
ZhouDevin12 分钟前
算法论文/模型微调1——CNN架构做lora微调训练
人工智能·深度学习·算法·架构·cnn
ZGi.ai13 分钟前
ZGI Runtime:切换模型后 Agent 为什么失效?
人工智能·aiagent·企业ai·模型切换·zgi·agentruntime
YH552698419 分钟前
有什么AI工具能将网课和视频播客的内容转化成文档?
人工智能·音视频
你最豪士19 分钟前
效率黑洞:被渲染进度条偷走的时间
人工智能
额恩6624 分钟前
NLP五类核心任务:归纳总结与详细讲解
人工智能·自然语言处理
zzzll111128 分钟前
Ollama:本地运行大型语言模型的轻量级解决方案
人工智能·语言模型·自然语言处理