百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

RL

> DevOps
开源

R.L. 方法和技术。

197 stars0 点赞5 次浏览
访问官网GitHub

工具介绍

R.L. 方法和技术。

Reinforcement Learning

Installation

bash
uv pip install -e .

Overview

This repository contains code that implements algorithms and models from Sutton's book on reinforcement learning. The book, titled "Reinforcement Learning: An Introduction," is a classic text on the subject and provides a comprehensive introduction to the field.

The code in this repository is organized into several modules, each of which covers differents topics.

Methods

  • Multi Armed Bandits
    • Epsilon Greedy
    • Optimistic Initial Values
    • Gradient
    • α (non stationary)
  • Model Based
    • Policy Evaluation
    • Policy Iteration
    • Value Iteration
  • Monte Carlo estimation and control
    • First-visit α-MC
    • Every-visit α-MC
    • MC with Exploring Starts
    • Off-policy MC, ordinary and weighted importance sampling
  • Temporal Difference
    • TD(n) estimation
    • n-step SARSA
    • n-step Q-learning
    • n-step Expected SARSA
    • double Q learning
    • n-step Tree Backup
  • Planning
    • Dyna-Q/Dyna-Q+
    • Prioritized Sweeping
    • Trajectory Sampling
    • MCTS
  • On-policy Prediction
    • Gradient MC
    • $n$-step semi-gradient TD
    • ANN
    • Least-Squares TD
    • Kernel-based
  • On-policy Control
    • Episodic semi-gradient
    • Semi-gradient n-step Sarsa
    • Differential Semi-gradient n-step Sarsa
  • Elegibility Traces
    • TD($\lambda$)
    • True Online
    • Sarsa($\lambda$)
    • True Online Sarsa($\lambda$)
  • Policy Gradient
    • REINFORCE: Monte Carlo Policy Gradient w/wo Baseline
    • Actor-Critic (episodic) w/wo eligibility traces
    • Actor-Critic (continuing) with eligibility traces

All model free solvers will work just by defining states actions and a trasition function. Transitions are defined as a function that takes a state and an action and returns a tuple of the next state and the reward. The transition function also returns a boolean indicating whether the episode has terminated.

python
states: Sequence[Any]
actions: Sequence[Any]
transtion: Callable[[Any, Any], tuple[tuple[Any, float], bool]]

Examples

Single State Infinite Variance Example 5.5

…

Monte Carlo Tree Search maze solving plot

python
s = START_XY
budget = 500
cp = 1/np.sqrt(2)
end = False
max_steps = 50
while not end:
    action, tree = mcts(s, cp, budget, obstacle_maze, action_map, max_steps, eps=1)
    (s, _), end = obstacle_maze(s, action)

tree.plot()

Contributing

While the code in this package provides a basic implementation of the algorithms from the book, it is not necessarily the most efficient or well-written. If you have suggestions for improving the code, please feel free to open an issue.

Overall, this package provides a valuable resource for anyone interested in learning about reinforcement learning and implementing algorithms from scratch. By no means prod ready.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythongridworldmarkovmarkov-decision-processesq-learning

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理