当前位置:网站首页>1、强化学习基础总结
1、强化学习基础总结
2022-07-22 18:47:00 【大力力无穷】
1、监督学习:
- 输入数据(标准的数据)没有关联
- 需要告诉机器学习器正确的标签是什么
2、独立同分布:
iid(independent and identically distributed)
假设样本空间中全体样本服从一个未知分布,我们获得的每个样本都是独立地从这个分布上采样获得的
3、强化学习的困难:
智能体不能得到即时的反馈,然而我们希望智能体能在这个环境中学习
4、强化学习和监督学习区别:
- 强化学习:有序数据 监督学习:独立数据
- 学习器:并没有告诉我们每一步正确的动作应该是什么,它需要自己去发现哪些动作可以带来最多的奖励
- 智能体获得能力的过程:不断试错过程(探索,利用)**(在监督学习里没有)*
- 强化学习:没有非常强的监督者,只有奖励信号,奖励信号是延迟的
- 强化学习:试错探索
5、早期强化学习:标准化学习
深度强化学习=强化学习+深度学习(deep reinforcement learning)
6、有序决策:
强化学习:
- 智能体与环境交互问题
- 近期奖励和远期奖励的权衡
7、状态:对世界的完整描述
观测:对状态的部分描述,可能会遗漏一些信息
8、深度强化学习:用实值得变量、矩阵,更高阶变量
9、马尔可夫决策:Markov decision process,MDP
部分可预测马尔可夫决策:(partially observable Markov decision process,POMDP)_
S,A,T,R,Ω,O,R
10、强化学习智能体:
- 策略
- 价值函数
- 模型
11、策略:
随机性策略(stochastic policy):(常用)
Π函数
优点:
- 更好探索
- 动作多样性
确定性策略(deterministic policy):直接采取最有可能的动作
12、价值函数:
折扣因子(discount factor)
13、模型:状态转移概率 奖励函数
14、强化学习智能体类型:
- 基于价值+基于策略=演员-评论员智能体
基于价值:不连续,离散,Q学习,Sarsa
基于策略:策略梯度(policy,Gradient,PG) - 有模型 免模型
15、单步强化学习:K-臂赌博机(K-armed bandit)(多臂赌博机)
16、Gym库:离散:gym.space.Discrete
连续:gym.space.Box
import gym # 导入 Gym 的 Python 接口环境包
env = gym.make('CartPole-v0') # 构建实验环境
env.reset() # 重置一个回合
for _ in range(1000):
env.render() # 显示图形界面
action = env.action_space.sample() # 从动作空间中随机选取一个动作
env.step(action) # 用于提交动作,括号内是具体的动作
env.close() # 关闭环境
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
env.render()
action = env.action_space.sample()
observation, reward, done, info = env.step(action)
print(observation)
env.close()
from gym import envs
env_specs = envs.registry.all()
envs_ids = [env_spec.id for env_spec in env_specs]
print(envs_ids)

import gym
env = gym.make('MountainCar-v0')
print('观测空间 = {}'.format(env.observation_space))
print('动作空间 = {}'.format(env.action_space))
print('观测范围 = {} ~ {}'.format(env.observation_space.low,
env.observation_space.high))
print('动作数 = {}'.format(env.action_space.n))
观测空间 = Box([-1.2 -0.07], [0.6 0.07], (2,), float32)
动作空间 = Discrete(3)
观测范围 = [-1.2 -0.07] ~ [0.6 0.07]
动作数 = 3
智能体“:
class BespokeAgent:
def __init__(self, env):
pass
def decide(self, observation): # 决策
position, velocity = observation
lb = min(-0.09 * (position + 0.25) ** 2 + 0.03,
0.3 * (position + 0.9) ** 4 - 0.008)
ub = -0.07 * (position + 0.38) ** 2 + 0.07
if lb < velocity < ub:
action = 2
else:
action = 0
return action # 返回动作
def learn(self, *args): # 学习
pass
agent = BespokeAgent(env)
边栏推荐
- Conditions affecting interface query speed
- 众昂矿业:萤石色彩丰富,极具审美价值
- How to open win11 task manager? Skills and methods of opening win11 Task Manager
- JS 复杂数据类型
- 如何为您的企业设置内部Wiki?
- Evolution Atlas of interface documents. People who have used the first interface document tool are exposed to their age
- China's open source is moving towards the second tier!
- OSPF中LSA相关内容
- Tan Zhongyi, the initiator of xingce community: promote the intelligent transformation of enterprises by means of open source
- Dao智能合约Dapp系统开发技术
猜你喜欢

【高等数学】函数可微与可导的区别

Which one works better, Yapi or apifox? In depth analysis of the functional features of Yapi and apifox

SFM与MVS区别

PWN stack overflow basic exercise - 2

微信小程序开发:第一个helloWorld

中年危机提前来临的一代人,还能够从容生活吗?

分布式学习和联邦学习简介

yapi和Apifox 哪个好用?深度分析 yapi 和Apifox 的功能特性

How to open win11 task manager? Skills and methods of opening win11 Task Manager

selenium报错解决
随机推荐
日常记账后,项目图表显示各种收支类别
R语言 动态气泡图
SFM与MVS区别
urllib的介绍和基本使用基本使用
China's open source is moving towards the second tier!
Pile up basic exercises - 1
ciscn_ 2019_ n_ 1 - two solutions
软件测试之移动APP安全测试简析,北京第三方软件检测机构分享
[basic 4] - document reading and writing, module
PWN --- ret2shellcode
Drawing lollipop chart with R language
安装不了schedule
Golang AES encryption and decryption
Evolution Atlas of interface documents. People who have used the first interface document tool are exposed to their age
If there is only express delivery order number, how to query the logistics progress and check the order number of the delivery
Configure point cloud library pcl1.12.1 for visualstudio2019 under win10 system
JS 复杂数据类型
Linux环境下oracle切换用户并查询数据库命令
Live video system source code, save platform video content locally
urllib的一个类型和六个方法