[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mpatacchiola--dissecting-reinforcement-learning":3,"tool-mpatacchiola--dissecting-reinforcement-learning":65},[4,23,32,40,49,57],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":22},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,2,"2026-04-05T10:45:23",[13,14,15,16,17,18,19,20,21],"图像","数据工具","视频","插件","Agent","其他","语言模型","开发框架","音频","ready",{"id":24,"name":25,"github_repo":26,"description_zh":27,"stars":28,"difficulty_score":29,"last_commit_at":30,"category_tags":31,"status":22},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,3,"2026-04-04T04:44:48",[17,13,20,19,18],{"id":33,"name":34,"github_repo":35,"description_zh":36,"stars":37,"difficulty_score":29,"last_commit_at":38,"category_tags":39,"status":22},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74913,"2026-04-05T10:44:17",[19,13,20,18],{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":46,"last_commit_at":47,"category_tags":48,"status":22},3215,"awesome-machine-learning","josephmisiti\u002Fawesome-machine-learning","awesome-machine-learning 是一份精心整理的机器学习资源清单，汇集了全球优秀的机器学习框架、库和软件工具。面对机器学习领域技术迭代快、资源分散且难以甄选的痛点，这份清单按编程语言（如 Python、C++、Go 等）和应用场景（如计算机视觉、自然语言处理、深度学习等）进行了系统化分类，帮助使用者快速定位高质量项目。\n\n它特别适合开发者、数据科学家及研究人员使用。无论是初学者寻找入门库，还是资深工程师对比不同语言的技术选型，都能从中获得极具价值的参考。此外，清单还延伸提供了免费书籍、在线课程、行业会议、技术博客及线下聚会等丰富资源，构建了从学习到实践的全链路支持体系。\n\n其独特亮点在于严格的维护标准：明确标记已停止维护或长期未更新的项目，确保推荐内容的时效性与可靠性。作为机器学习领域的“导航图”，awesome-machine-learning 以开源协作的方式持续更新，旨在降低技术探索门槛，让每一位从业者都能高效地站在巨人的肩膀上创新。",72149,1,"2026-04-03T21:50:24",[20,18],{"id":50,"name":51,"github_repo":52,"description_zh":53,"stars":54,"difficulty_score":46,"last_commit_at":55,"category_tags":56,"status":22},2234,"scikit-learn","scikit-learn\u002Fscikit-learn","scikit-learn 是一个基于 Python 构建的开源机器学习库，依托于 SciPy、NumPy 等科学计算生态，旨在让机器学习变得简单高效。它提供了一套统一且简洁的接口，涵盖了从数据预处理、特征工程到模型训练、评估及选择的全流程工具，内置了包括线性回归、支持向量机、随机森林、聚类等在内的丰富经典算法。\n\n对于希望快速验证想法或构建原型的数据科学家、研究人员以及 Python 开发者而言，scikit-learn 是不可或缺的基础设施。它有效解决了机器学习入门门槛高、算法实现复杂以及不同模型间调用方式不统一的痛点，让用户无需重复造轮子，只需几行代码即可调用成熟的算法解决分类、回归、聚类等实际问题。\n\n其核心技术亮点在于高度一致的 API 设计风格，所有估算器（Estimator）均遵循相同的调用逻辑，极大地降低了学习成本并提升了代码的可读性与可维护性。此外，它还提供了强大的模型选择与评估工具，如交叉验证和网格搜索，帮助用户系统地优化模型性能。作为一个由全球志愿者共同维护的成熟项目，scikit-learn 以其稳定性、详尽的文档和活跃的社区支持，成为连接理论学习与工业级应用的最",65628,"2026-04-05T10:10:46",[20,18,14],{"id":58,"name":59,"github_repo":60,"description_zh":61,"stars":62,"difficulty_score":10,"last_commit_at":63,"category_tags":64,"status":22},3364,"keras","keras-team\u002Fkeras","Keras 是一个专为人类设计的深度学习框架，旨在让构建和训练神经网络变得简单直观。它解决了开发者在不同深度学习后端之间切换困难、模型开发效率低以及难以兼顾调试便捷性与运行性能的痛点。\n\n无论是刚入门的学生、专注算法的研究人员，还是需要快速落地产品的工程师，都能通过 Keras 轻松上手。它支持计算机视觉、自然语言处理、音频分析及时间序列预测等多种任务。\n\nKeras 3 的核心亮点在于其独特的“多后端”架构。用户只需编写一套代码，即可灵活选择 TensorFlow、JAX、PyTorch 或 OpenVINO 作为底层运行引擎。这一特性不仅保留了 Keras 一贯的高层易用性，还允许开发者根据需求自由选择：利用 JAX 或 PyTorch 的即时执行模式进行高效调试，或切换至速度最快的后端以获得最高 350% 的性能提升。此外，Keras 具备强大的扩展能力，能无缝从本地笔记本电脑扩展至大规模 GPU 或 TPU 集群，是连接原型开发与生产部署的理想桥梁。",63927,"2026-04-04T15:24:37",[20,14,18],{"id":66,"github_repo":67,"name":68,"description_en":69,"description_zh":70,"ai_summary_zh":71,"readme_en":72,"readme_zh":73,"quickstart_zh":74,"use_case_zh":75,"hero_image_url":76,"owner_login":77,"owner_name":78,"owner_avatar_url":79,"owner_bio":80,"owner_company":81,"owner_location":82,"owner_email":83,"owner_twitter":83,"owner_website":84,"owner_url":85,"languages":86,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":46,"env_os":95,"env_gpu":96,"env_ram":96,"env_deps":97,"category_tags":102,"github_topics":103,"view_count":10,"oss_zip_url":83,"oss_zip_packed_at":83,"status":22,"created_at":117,"updated_at":118,"faqs":119,"releases":150},2466,"mpatacchiola\u002Fdissecting-reinforcement-learning","dissecting-reinforcement-learning","Python code, PDFs and resources for the series of posts on Reinforcement Learning which I published on my personal blog","dissecting-reinforcement-learning 是一个专为强化学习初学者和从业者设计的开源教育资源库。它系统性地整理了一系列关于强化学习的博客文章、配套 Python 代码示例以及可离线阅读的 PDF 文档，旨在帮助读者从理论到实践全面掌握这一领域。\n\n对于许多希望进入强化学习领域的开发者而言，复杂的数学推导和抽象算法往往是巨大的入门障碍。dissecting-reinforcement-learning 通过“拆解”式教学，将马尔可夫决策过程、贝尔曼方程、蒙特卡洛方法、时序差分学习（如 Q-Learning 和 SARSA）、Actor-Critic 方法以及进化算法等核心概念转化为直观的代码实现。它不仅涵盖了基础理论，还深入探讨了函数近似、非线性逼近及策略梯度等高阶主题，并提供了包括多臂老虎机、倒立摆控制在内的多个经典应用场景代码，有效解决了理论学习与实际编程脱节的问题。\n\n该资源库特别适合人工智能专业的学生、初级算法工程师以及对强化学习感兴趣的研究人员使用。其独特的技术亮点在于极高的易用性和轻量化设计：所有代码仅依赖 Numpy 和 Matplotlib 等基","dissecting-reinforcement-learning 是一个专为强化学习初学者和从业者设计的开源教育资源库。它系统性地整理了一系列关于强化学习的博客文章、配套 Python 代码示例以及可离线阅读的 PDF 文档，旨在帮助读者从理论到实践全面掌握这一领域。\n\n对于许多希望进入强化学习领域的开发者而言，复杂的数学推导和抽象算法往往是巨大的入门障碍。dissecting-reinforcement-learning 通过“拆解”式教学，将马尔可夫决策过程、贝尔曼方程、蒙特卡洛方法、时序差分学习（如 Q-Learning 和 SARSA）、Actor-Critic 方法以及进化算法等核心概念转化为直观的代码实现。它不仅涵盖了基础理论，还深入探讨了函数近似、非线性逼近及策略梯度等高阶主题，并提供了包括多臂老虎机、倒立摆控制在内的多个经典应用场景代码，有效解决了理论学习与实际编程脱节的问题。\n\n该资源库特别适合人工智能专业的学生、初级算法工程师以及对强化学习感兴趣的研究人员使用。其独特的技术亮点在于极高的易用性和轻量化设计：所有代码仅依赖 Numpy 和 Matplotlib 等基础库，无需安装庞大的深度学习框架；内置的环境模块独立且轻量，兼容 Linux、Windows、macOS 甚至树莓派等嵌入式设备，遵循类似 OpenAI Gym 的接口规范，方便用户快速上手实验与二次开发。此外，项目还持续收录社区推荐的优质参考资料，是一个兼具深度与广度的实用学习平台。","\n\n\u003Cdiv style=\"text-align:center\">\u003Cimg src =\".\u002Fimages\u002Flocal\u002Fheader.png\" \u002F>\u003C\u002Fdiv>\n\nThis repository contains the code and pdf of a series of blog post called \"dissecting reinforcement learning\" which I published on my blog [mpatacchiola.io\u002Fblog](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F). Moreover there are links to resources that can be useful for a reinforcement learning practitioner. **If you have some good references which may be of interest please send me a pull request and I will integrate them in the README**.\n\nThe source code is contained in [src](.\u002Fsrc) with the name of the subfolders following the post number. In [pdf](.\u002Fpdf) there are the A3 documents of each post for offline reading. In [images](.\u002Fimages) there are the raw svg file containing the images used in each post.\n\nInstallation\n------------\n\nThe source code does not require any particular installation procedure. The code can be used in **Linux**, **Windows**, **OS X**, and embedded devices like **Raspberry Pi**, **BeagleBone**, and **Intel Edison**. The only requirement is *Numpy* which is already present in Linux and can be easily installed in Windows and OS X through [Anaconda](https:\u002F\u002Fconda.io\u002Fdocs\u002Finstall\u002Ffull.html) or [Miniconda](https:\u002F\u002Fconda.io\u002Fminiconda.html). Some examples require [Matplotlib](https:\u002F\u002Fmatplotlib.org\u002F) for data visualization and animations.\n\nPosts Content\n------------\n\n1. [[Post one]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2016\u002F12\u002F09\u002Fdissecting-reinforcement-learning.html) [[code]](.\u002Fsrc\u002F1) [[pdf]](.\u002Fpdf) - Markov chains. Markov Decision Process. Bellman Equation. Value and Policy iteration algorithms. \n\n2. [[Post two]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F01\u002F15\u002Fdissecting-reinforcement-learning-2.html) [[code]](.\u002Fsrc\u002F2) [[pdf]](.\u002Fpdf) - Monte Carlo methods for prediction and control. Generalised Policy Iteration. Action Values and Q-function.\n\n3. [[Post three]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F01\u002F29\u002Fdissecting-reinforcement-learning-3.html) [[code]](.\u002Fsrc\u002F3) [[pdf]](.\u002Fpdf) - Temporal Differencing Learning, Animal Learning, TD(0), TD(λ) and Eligibility Traces, SARSA, Q-Learning.\n\n4. [[Post four]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F02\u002F11\u002Fdissecting-reinforcement-learning-4.html) [[code]](.\u002Fsrc\u002F4) [[pdf]](.\u002Fpdf) - Neurobiology behind Actor-Critic methods, computational Actor-Critic methods, Actor-only and Critic-only methods.\n\n5. [[Post five]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F03\u002F14\u002Fdissecting-reinforcement-learning-5.html) [[code]](.\u002Fsrc\u002F5) [[pdf]](.\u002Fpdf) - Evolutionary Algorithms introduction, Genetic Algorithm in Reinforcement Learning, Genetic Algorithms for policy selection.\n\n6. [[Post six]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F08\u002F14\u002Fdissecting-reinforcement-learning-6.html) [[code]](.\u002Fsrc\u002F6) [[pdf]](.\u002Fpdf) - Reinforcement learning applications, Multi-Armed Bandit, Mountain Car, Inverted Pendulum, Drone landing, Hard problems.\n\n7. [[Post seven]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F12\u002F11\u002Fdissecting-reinforcement-learning-7.html) [[code]](.\u002Fsrc\u002F7) [[pdf]](.\u002Fpdf) - Function approximation, Intuition, Linear approximator, Applications, High-order approximators.\n\n8. [[Post eight]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2018\u002F12\u002F28\u002Fdissecting-reinforcement-learning-8.html) [[code]](.\u002Fsrc\u002F8) [[pdf]](.\u002Fpdf) - Non-linear function approximation, Perceptron, Multi Layer Perceptron, Applications, Policy Gradient.\n\nEnvironments\n-------------\n\nThe folder called `environments` contains all the environments used in the series. Differently from other libraries (such as OpenAI Gym) the environments are stand-alone python files that do no require any installation procedure. You can use an environment copying the file in the same folder of your project, and then loading it from a Python script: `from environmentname import EnvironmentName`. The environment can be used following the same convention adopted by OpenAI Gym:\n\n```python\nfrom random import randint #to generate random integers\nfrom inverted_pendulum import InvertedPendulum #importing the environment\n\n#Generating the environment\nenv = InvertedPendulum(pole_mass=2.0, cart_mass=8.0, pole_lenght=0.5, delta_t=0.1)\n#Reset the environment before the episode starts\nobservation = env.reset(exploring_starts=True) \n\nfor step in range(100):\n    action = randint(0, 2) #generate a random integer\u002Faction\n    observation, reward, done = env.step(action) #one step in the environment\n    if done == True: break #exit if the episode is finished\n\n#Saving the episode in a GIF\nenv.render(file_path='.\u002Finverted_pendulum.gif', mode='gif')\n```\n\nThe snippet above generate an inverted pendulum environment. The pole is controlled through three actions (0=left, 1=noop, 2=right) that are randomly generated through the `randint()` method. The maximum number of steps allowed is 100, that with `delta_t=0.1` corresponds to 10 seconds. The episode can finish in advance if the pole falls down leading to `done = True`. Examples for each environments are available [here](.\u002Fsrc\u002F6). The following is a description of the available environments with a direct link to the python code:\n\n- **grid world**: a simple grid-world which includes obstacles, walls, positive and negative rewards. An agent can move in the environment using four actions (0=forward, 1=right, 2=backward, 3=left). It is possible to setup the dimension of the world, the location of the obstacles, and the movement noise [[code]](.\u002Fenvironments\u002Fgridworld.py) \n\n- **multi-armed bandit**: implementation of a [multi-armed](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMulti-armed_bandit) environment that can be initialized with a specific number of arms. Rewards are binary (1 or 0) and are given for each arm with a pre-defined probability. This world does not have a `reset()` method because for definition the episode only has a single step [[code]](.\u002Fenvironments\u002Fmulti_armed_bandit.py)\n\n- **inverted pendulum**: it is an implementation of the [classic problem](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInverted_pendulum) widely used in control theory. The pendulum can be initialized with a specific pole mass, cart mass, and pole length. There are three possible actions (0=left, 1=noop, 2=right). A method called `render()` allows saving a GIF or an MP4 of the last episode using Matplotlib [[code]](.\u002Fenvironments\u002Finverted_pendulum.py)\n\n- **mountain car**: implementation of the [classic problem](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMountain_car_problem) which is a widely used benchmark. The environment is initialized with a specific mass for the car, friction for the soil, and delta time. There are only three actions available (0=left, 1=noop, 2=right). Rendering is possible and allows saving a GIF or video using Matplotlib animations [[code]](.\u002Fenvironments\u002Fmountain_car.py)\n\n- **drone landing**: a drone has to land on a pad at the centre of a cubic room, moving in six possible directions (0=forward, 1=left, 2=backward, 3=right, 4=up, 5=down). The dimension of the world can be declared during the initialization. Positive reward of +1 is obtained if the drone touch the pad, whereas a negative reward of -1 is given in case of a wrong landing. Rendering is allowed and the file is stored as GIF or MP4 [[code]](.\u002Fenvironments\u002Fdrone_landing.py)\n\n\n\nResources\n---------\n\n**Software:**\n\n- [[Google DeepMind Lab]](https:\u002F\u002Fdeepmind.com\u002Fblog\u002Fopen-sourcing-deepmind-lab\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Flab) - DeepMind Lab is a fully 3D game-like platform tailored for agent-based AI research.\n\n- [[OpenAI Gym]](https:\u002F\u002Fgym.openai.com\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fgym) - A toolkit for developing and comparing reinforcement learning algorithms.\n\n- [[OpenAI Universe]](https:\u002F\u002Funiverse.openai.com\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Fopenai\u002Funiverse) - Measurement and training for artificial intelligence.\n\n- [[RL toolkit]](http:\u002F\u002Fincompleteideas.net\u002Frlai.cs.ualberta.ca\u002FRLAI\u002FRLtoolkit\u002FRLtoolkit1.0.html) - Collection of utilities and demos developed by the RLAI group which may be useful for anyone trying to learn, teach or use reinforcement learning (by Richard Sutton).\n\n- [[setosa blog]](http:\u002F\u002Fsetosa.io\u002Fblog\u002F2014\u002F07\u002F26\u002Fmarkov-chains\u002Findex.html) - A useful visual explanation of Markov chains.\n\n- [[Tensorflow playground]](https:\u002F\u002Fplayground.tensorflow.org) - Try different MLP architectures and datasets on the browser.\n\n**Books and Articles:**\n\n- **Artificial intelligence: a modern approach. (chapters 17 and 21)** Russell, S. J., Norvig, P., Canny, J. F., Malik, J. M., & Edwards, D. D. (2003). Upper Saddle River: Prentice hall. [[web]](http:\u002F\u002Faima.cs.berkeley.edu\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Faimacode)\n\n- **Christopher Watkins** doctoral dissertation, which introduced the **Q-learning** for the first time [[pdf]](https:\u002F\u002Fwww.researchgate.net\u002Fprofile\u002FChristopher_Watkins2\u002Fpublication\u002F33784417_Learning_From_Delayed_Rewards\u002Flinks\u002F53fe12e10cf21edafd142e03\u002FLearning-From-Delayed-Rewards.pdf)\n\n- **Evolutionary Algorithms for Reinforcement Learning.** Moriarty, D. E., Schultz, A. C., & Grefenstette, J. J. (1999). [[pdf]](https:\u002F\u002Fwww.jair.org\u002Fmedia\u002F613\u002Flive-613-1809-jair.pdf)\n\n- **Machine Learning (chapter 13)** Mitchell T. (1997) [[web]](http:\u002F\u002Fwww.cs.cmu.edu\u002F~tom\u002Fmlbook.html)\n\n- **Reinforcement learning: An introduction.** Sutton, R. S., & Barto, A. G. (1998). Cambridge: MIT press. [[html]](https:\u002F\u002Fwebdocs.cs.ualberta.ca\u002F~sutton\u002Fbook\u002Febook\u002Fthe-book.html)\n\n- **Reinforcement learning: An introduction (second edition).** Sutton, R. S., & Barto, A. G. (draft April 2018). [TODO]\n\n- **Reinforcement Learning in a Nutshell.** Heidrich-Meisner, V., Lauer, M., Igel, C., & Riedmiller, M. A. (2007) [[pdf]](http:\u002F\u002Fciteseerx.ist.psu.edu\u002Fviewdoc\u002Fdownload?doi=10.1.1.69.9557&rep=rep1&type=pdf)\n\n- **Statistical Reinforcement Learning: Modern Machine Learning Approaches**, Sugiyama, M. (2015) [[web]](https:\u002F\u002Fwww.crcpress.com\u002FStatistical-Reinforcement-Learning-Modern-Machine-Learning-Approaches\u002FSugiyama\u002Fp\u002Fbook\u002F9781439856895)\n\n\nLicense\n--------\nThe MIT License (MIT)\nCopyright (c) 2017 Massimiliano Patacchiola\nWebsite: http:\u002F\u002Fmpatacchiola.github.io\u002Fblog\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY \nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE \nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","\u003Cdiv style=\"text-align:center\">\u003Cimg src =\".\u002Fimages\u002Flocal\u002Fheader.png\" \u002F>\u003C\u002Fdiv>\n\n此仓库包含了我在博客 [mpatacchiola.io\u002Fblog](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F) 上发表的系列博文“剖析强化学习”的代码及PDF文档。此外，还提供了一些对强化学习从业者可能有用的资源链接。**如果您有值得推荐的好资料，请提交Pull Request，我会将其整合到README中**。\n\n源代码位于[src](.\u002Fsrc)目录下，子文件夹的命名与博文编号一致。[pdf](.\u002Fpdf)目录中存放了每篇博文的A3格式文档，方便离线阅读。[images](.\u002Fimages)目录则包含各篇博文中使用的原始SVG图像文件。\n\n安装\n----\n\n源代码无需特殊的安装步骤。该代码可在**Linux**、**Windows**、**OS X**以及嵌入式设备如**树莓派**、**BeagleBone**和**Intel Edison**上运行。唯一的要求是安装*Numpy*，它在Linux系统中通常已预装；而在Windows和OS X上，可以通过[Anaconda](https:\u002F\u002Fconda.io\u002Fdocs\u002Finstall\u002Ffull.html)或[Miniconda](https:\u002F\u002Fconda.io\u002Fminiconda.html)轻松安装。部分示例还需要使用[Matplotlib](https:\u002F\u002Fmatplotlib.org\u002F)进行数据可视化和动画展示。\n\n博文内容\n--------\n\n1. [[第一篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2016\u002F12\u002F09\u002Fdissecting-reinforcement-learning.html) [[代码]](.\u002Fsrc\u002F1) [[PDF]](.\u002Fpdf) - 马尔可夫链、马尔可夫决策过程、贝尔曼方程、值迭代与策略迭代算法。\n\n2. [[第二篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F01\u002F15\u002Fdissecting-reinforcement-learning-2.html) [[代码]](.\u002Fsrc\u002F2) [[PDF]](.\u002Fpdf) - 用于预测与控制的蒙特卡洛方法、广义策略迭代、动作价值函数与Q函数。\n\n3. [[第三篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F01\u002F29\u002Fdissecting-reinforcement-learning-3.html) [[代码]](.\u002Fsrc\u002F3) [[PDF]](.\u002Fpdf) - 时序差分学习、动物学习、TD(0)、TD(λ)与资格迹、SARSA、Q学习。\n\n4. [[第四篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F02\u002F11\u002Fdissecting-reinforcement-learning-4.html) [[代码]](.\u002Fsrc\u002F4) [[PDF]](.\u002Fpdf) - 执行者-评论家方法背后的神经生物学、计算型执行者-评论家方法、仅执行者与仅评论家方法。\n\n5. [[第五篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F03\u002F14\u002Fdissecting-reinforcement-learning-5.html) [[代码]](.\u002Fsrc\u002F5) [[PDF]](.\u002Fpdf) - 进化算法简介、遗传算法在强化学习中的应用、用于策略选择的遗传算法。\n\n6. [[第六篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F08\u002F14\u002Fdissecting-reinforcement-learning-6.html) [[代码]](.\u002Fsrc\u002F6) [[PDF]](.\u002Fpdf) - 强化学习的应用、多臂老虎机问题、山地车问题、倒立摆问题、无人机着陆问题、以及其他难题。\n\n7. [[第七篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2017\u002F12\u002F11\u002Fdissecting-reinforcement-learning-7.html) [[代码]](.\u002Fsrc\u002F7) [[PDF]](.\u002Fpdf) - 函数逼近、直观理解、线性逼近器、应用场景、高阶逼近器。\n\n8. [[第八篇]](https:\u002F\u002Fmpatacchiola.github.io\u002Fblog\u002F2018\u002F12\u002F28\u002Fdissecting-reinforcement-learning-8.html) [[代码]](.\u002Fsrc\u002F8) [[PDF]](.\u002Fpdf) - 非线性函数逼近、感知机、多层感知机、应用场景、策略梯度。\n\n环境\n----\n\n名为`environments`的文件夹中包含了本系列文章所使用的所有环境。与其他库（如OpenAI Gym）不同，这些环境都是独立的Python文件，无需任何安装步骤。您只需将相应文件复制到项目目录中，然后在Python脚本中通过`from environmentname import EnvironmentName`语句导入即可。这些环境的使用方式与OpenAI Gym保持一致：\n\n```python\nfrom random import randint #用于生成随机整数\nfrom inverted_pendulum import InvertedPendulum #导入环境\n\n#创建环境\nenv = InvertedPendulum(pole_mass=2.0, cart_mass=8.0, pole_lenght=0.5, delta_t=0.1)\n#在每轮实验开始前重置环境\nobservation = env.reset(exploring_starts=True) \n\nfor step in range(100):\n    action = randint(0, 2) #随机生成一个动作\n    observation, reward, done = env.step(action) #执行一步操作\n    if done == True: break #如果实验结束则退出\n\n#将实验过程保存为GIF\nenv.render(file_path='.\u002Finverted_pendulum.gif', mode='gif')\n```\n\n上述代码片段创建了一个倒立摆环境。摆杆可通过三种动作（0=左，1=静止，2=右）进行控制，动作由`randint()`方法随机生成。最大步数设为100步，结合`delta_t=0.1`的时间间隔，相当于10秒的实验时间。若摆杆倒下，则`done`会变为True，实验提前结束。每个环境的示例均可在[此处](.\u002Fsrc\u002F6)找到。以下是可用环境的简要说明及其对应的Python代码链接：\n\n- **网格世界**：一个简单的网格世界环境，包含障碍物、墙壁以及正负奖励。智能体可通过四种动作（0=前进，1=右，2=后退，3=左）在环境中移动。可以自定义网格的尺寸、障碍物的位置以及运动噪声[[代码]](.\u002Fenvironments\u002Fgridworld.py)\n\n- **多臂老虎机**：实现了一个[多臂老虎机](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMulti-armed_bandit)环境，可指定老虎机的臂数。每次触发都会以预先设定的概率获得奖励（1或0）。由于其特性，该环境没有`reset()`方法，因为每一轮实验仅包含一步[[代码]](.\u002Fenvironments\u002Fmulti_armed_bandit.py)\n\n- **倒立摆**：实现了[经典倒立摆问题](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInverted_pendulum)，广泛应用于控制理论。倒立摆可自定义摆杆质量、小车质量及摆长，并提供三种动作选项（0=左，1=静止，2=右）。通过`render()`方法，可以利用Matplotlib将最近一次实验过程保存为GIF或MP4[[代码]](.\u002Fenvironments\u002Finverted_pendulum.py)\n\n- **山地车**：实现了[经典山地车问题](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMountain_car_problem)，是一个常用的基准测试场景。环境可自定义车辆质量、地面摩擦系数及时间步长。仅有三种动作可供选择（0=左，1=静止，2=右）。同样支持渲染功能，可利用Matplotlib动画将实验过程保存为GIF或视频[[代码]](.\u002Fenvironments\u002Fmountain_car.py)\n\n- **无人机着陆**：一架无人机必须降落在一个立方体房间中心的平台上，可以在六个可能的方向上移动（0=向前，1=向左，2=向后，3=向右，4=向上，5=向下）。世界的空间尺寸可以在初始化时声明。如果无人机触碰到平台，则获得+1的正奖励；若着陆位置错误，则给予-1的负奖励。允许进行渲染，文件可保存为GIF或MP4格式 [[代码]](.\u002Fenvironments\u002Fdrone_landing.py)\n\n\n\n资源\n---------\n\n**软件：**\n\n- [[Google DeepMind Lab]](https:\u002F\u002Fdeepmind.com\u002Fblog\u002Fopen-sourcing-deepmind-lab\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Flab) - DeepMind Lab是一个完全三维的游戏化平台，专为基于智能体的人工智能研究而设计。\n\n- [[OpenAI Gym]](https:\u002F\u002Fgym.openai.com\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fgym) - 用于开发和比较强化学习算法的工具包。\n\n- [[OpenAI Universe]](https:\u002F\u002Funiverse.openai.com\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Fopenai\u002Funiverse) - 用于人工智能的测量与训练。\n\n- [[RL工具包]](http:\u002F\u002Fincompleteideas.net\u002Frlai.cs.ualberta.ca\u002FRLAI\u002FRLtoolkit\u002FRLtoolkit1.0.html) - RLAI小组开发的一系列实用工具和演示程序，对任何想要学习、教授或应用强化学习的人都很有帮助（由Richard Sutton编写）。\n\n- [[setosa博客]](http:\u002F\u002Fsetosa.io\u002Fblog\u002F2014\u002F07\u002F26\u002Fmarkov-chains\u002Findex.html) - 对马尔可夫链的有用可视化解释。\n\n- [[TensorFlow游乐场]](https:\u002F\u002Fplayground.tensorflow.org) - 在浏览器中尝试不同的多层感知机架构和数据集。\n\n**书籍和文章：**\n\n- **《人工智能：一种现代 approach》（第17章和第21章）** Russell, S. J., Norvig, P., Canny, J. F., Malik, J. M., & Edwards, D. D. (2003). Upper Saddle River: Prentice hall. [[网页]](http:\u002F\u002Faima.cs.berkeley.edu\u002F) [[github]](https:\u002F\u002Fgithub.com\u002Faimacode)\n\n- **Christopher Watkins** 的博士论文，首次提出了**Q-learning**算法 [[pdf]](https:\u002F\u002Fwww.researchgate.net\u002Fprofile\u002FChristopher_Watkins2\u002Fpublication\u002F33784417_Learning_From_Delayed_Rewards\u002Flinks\u002F53fe12e10cf21edafd142e03\u002FLearning-From-Delayed-Rewards.pdf)\n\n- **《强化学习中的进化算法》** Moriarty, D. E., Schultz, A. C., & Grefenstette, J. J. (1999). [[pdf]](https:\u002F\u002Fwww.jair.org\u002Fmedia\u002F613\u002Flive-613-1809-jair.pdf)\n\n- **《机器学习》（第13章）** Mitchell T. (1997) [[网页]](http:\u002F\u002Fwww.cs.cmu.edu\u002F~tom\u002Fmlbook.html)\n\n- **《强化学习导论》** Sutton, R. S., & Barto, A. G. (1998). Cambridge: MIT press. [[html]](https:\u002F\u002Fwebdocs.cs.ualberta.ca\u002F~sutton\u002Fbook\u002Febook\u002Fthe-book.html)\n\n- **《强化学习导论（第二版）》** Sutton, R. S., & Barto, A. G. (草稿，2018年4月)。[待完成]\n\n- **《强化学习精要》** Heidrich-Meisner, V., Lauer, M., Igel, C., & Riedmiller, M. A. (2007) [[pdf]](http:\u002F\u002Fciteseerx.ist.psu.edu\u002Fviewdoc\u002Fdownload?doi=10.1.1.69.9557&rep=rep1&type=pdf)\n\n- **《统计强化学习：现代机器学习方法》** Sugiyama, M. (2015) [[网页]](https:\u002F\u002Fwww.crcpress.com\u002FStatistical-Reinforcement-Learning-Modern-Machine-Learning-Approaches\u002FSugiyama\u002Fp\u002Fbook\u002F9781439856895)\n\n\n许可证\n--------\nMIT 许可证（MIT）\n版权所有 © 2017 Massimiliano Patacchiola\n网站：http:\u002F\u002Fmpatacchiola.github.io\u002Fblog\n\n本软件按“原样”提供，不提供任何形式的明示或暗示保证，包括但不限于适销性、特定用途适用性和非侵权性。在任何情况下，作者或版权所有者均不对因本软件或其使用而引起的任何索赔、损害或其他责任负责，无论该等责任是基于合同、侵权行为或其他原因产生的。","# dissecting-reinforcement-learning 快速上手指南\n\n`dissecting-reinforcement-learning` 是一个包含强化学习系列博客文章代码、PDF 文档及独立仿真环境的开源项目。该项目旨在通过从零实现的代码帮助开发者深入理解强化学习核心算法。\n\n## 环境准备\n\n### 系统要求\n该项目的源代码无需复杂安装，支持以下平台：\n*   **操作系统**：Linux, Windows, OS X\n*   **嵌入式设备**：Raspberry Pi, BeagleBone, Intel Edison\n\n### 前置依赖\n*   **必需库**：`Numpy`\n    *   Linux 系统通常预装。\n    *   Windows 和 OS X 建议通过 [Anaconda](https:\u002F\u002Fconda.io\u002Fdocs\u002Finstall\u002Ffull.html) 或 [Miniconda](https:\u002F\u002Fconda.io\u002Fminiconda.html) 安装。\n*   **可选库**：`Matplotlib`\n    *   用于部分示例的数据可视化和动画生成（如保存 GIF\u002FMP4）。\n\n## 安装步骤\n\n本项目无需传统的 `pip install` 或编译过程。只需克隆仓库即可使用：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning.git\ncd dissecting-reinforcement-learning\n```\n\n确保你的 Python 环境中已安装 `numpy`（以及可选的 `matplotlib`）：\n\n```bash\npip install numpy matplotlib\n```\n\n## 基本使用\n\n### 1. 目录结构说明\n*   `src\u002F`：包含与博客文章对应的源代码，子文件夹以文章编号命名（如 `src\u002F1` 对应第一篇关于马尔可夫链的文章）。\n*   `pdf\u002F`：每篇文章的 A3 格式 PDF 文档，适合离线阅读。\n*   `environments\u002F`：包含独立的 Python 仿真环境文件，无需额外安装即可导入使用。\n\n### 2. 使用独立仿真环境\n该项目提供了一套类似 OpenAI Gym 接口的独立环境（如倒立摆、山地车、无人机着陆等）。你可以直接将 `environments` 文件夹中的 `.py` 文件复制到你的项目目录下，然后导入使用。\n\n以下以**倒立摆（Inverted Pendulum）**为例，展示如何初始化环境、执行随机动作并保存动画：\n\n```python\nfrom random import randint # 用于生成随机整数动作\nfrom inverted_pendulum import InvertedPendulum # 导入环境类\n\n# 1. 初始化环境\n# 参数包括：杆质量、车质量、杆长度、时间步长\nenv = InvertedPendulum(pole_mass=2.0, cart_mass=8.0, pole_lenght=0.5, delta_t=0.1)\n\n# 2. 重置环境（exploring_starts=True 表示随机初始状态）\nobservation = env.reset(exploring_starts=True) \n\n# 3. 运行 episode\nfor step in range(100):\n    action = randint(0, 2) # 生成随机动作: 0=左, 1=不动, 2=右\n    # 执行一步动作，获取观测值、奖励和结束标志\n    observation, reward, done = env.step(action) \n    if done == True: \n        break # 如果杆倒下，提前结束\n\n# 4. 将本次 episode 保存为 GIF 动画\nenv.render(file_path='.\u002Finverted_pendulum.gif', mode='gif')\n```\n\n### 3. 可用环境列表\n所有环境均位于 `environments\u002F` 目录下，遵循相同的调用规范：\n\n*   **Grid World** (`gridworld.py`): 简单的网格世界，支持障碍物、墙壁及正负奖励设置。\n*   **Multi-Armed Bandit** (`multi_armed_bandit.py`): 多臂老虎机环境，用于测试探索与利用策略。\n*   **Inverted Pendulum** (`inverted_pendulum.py`): 经典倒立摆控制问题。\n*   **Mountain Car** (`mountain_car.py`): 经典山地车问题，考验长期奖励规划。\n*   **Drone Landing** (`drone_landing.py`): 无人机在立方体房间内着陆的任务。\n\n> **提示**：更多具体算法的实现代码（如 Q-Learning, SARSA, Actor-Critic 等）请参考 `src\u002F` 目录下对应章节的代码文件。","某高校人工智能专业的研究生李明，正在撰写关于“强化学习基础算法对比”的毕业论文。他需要复现经典的倒立摆（Inverted Pendulum）控制实验，并深入理解 Q-Learning 与策略梯度方法的底层数学原理，以便在论文中提供详实的理论推导和代码验证。\n\n### 没有 dissecting-reinforcement-learning 时\n- **环境配置繁琐**：为了运行一个简单的倒立摆示例，李明不得不安装庞大的 OpenAI Gym 库及其依赖项，不仅占用大量磁盘空间，还常因版本冲突导致调试中断。\n- **理论代码脱节**：网上找到的开源代码往往缺乏详细的数学注释，李明难以将贝尔曼方程、时序差分等抽象公式与具体的 Python 代码行对应起来，理解成本极高。\n- **资源分散低效**：他需要在多个博客、论坛和学术网站间跳跃，搜集从马尔可夫链到演员-评论家（Actor-Critic）方法的碎片化资料，整理耗时且容易遗漏关键细节。\n- **离线阅读困难**：大部分优质教程仅支持在线阅读，缺乏结构化的 PDF 文档，不利于他在无网络环境下进行深度研读和笔记标注。\n\n### 使用 dissecting-reinforcement-learning 后\n- **轻量级环境即插即用**：直接复制仓库中独立的 `inverted_pendulum.py` 文件即可运行，无需安装额外重型库，完美适配他的笔记本电脑甚至树莓派设备，极大简化了开发流程。\n- **代码与理论精准映射**：参考配套的系列博文和源码，每一行关键算法（如 TD(λ) 或 Eligibility Traces）都有清晰的逻辑解释，帮助他迅速打通从数学公式到代码实现的“最后一公里”。\n- **系统化知识体系**：仓库按主题分章（从马尔可夫决策过程到非线性函数近似），提供了从基础到进阶的完整学习路径，让他能高效构建系统的知识框架，避免盲人摸象。\n- **便捷的离线资料**：内置的高质量 A3 格式 PDF 文档方便他随时打印或平板批注，结合 SVG 原图，使论文中的图表绘制和理论引用更加规范准确。\n\ndissecting-reinforcement-learning 通过提供轻量级代码环境与系统化理论资料的完美结合，显著降低了强化学习初学者的入门门槛与研究效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmpatacchiola_dissecting-reinforcement-learning_8dd0df56.png","mpatacchiola","Massimiliano Patacchiola","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmpatacchiola_3b49c27b.jpg","Senior AI Research Engineer at Tools for Humanity. Likes Machine\u002FDeep\u002FReinforcement Learning.","Tools for Humanity","Dubai",null,"http:\u002F\u002Fmpatacchiola.github.io","https:\u002F\u002Fgithub.com\u002Fmpatacchiola",[87],{"name":88,"color":89,"percentage":90},"Python","#3572A5",100,624,179,"2026-01-10T14:57:34","MIT","Linux, Windows, macOS","未说明",{"notes":98,"python":96,"dependencies":99},"该工具无需特定安装过程，代码可在 Linux、Windows、macOS 以及 Raspberry Pi、BeagleBone、Intel Edison 等嵌入式设备上运行。唯一必须的依赖是 Numpy（Linux 通常预装，Windows\u002FmacOS 可通过 Anaconda 或 Miniconda 安装）。部分示例需要 Matplotlib 用于数据可视化和动画生成。环境文件为独立的 Python 文件，无需安装，可直接导入使用。",[100,101],"Numpy","Matplotlib",[18],[104,105,106,107,108,109,110,111,112,113,114,68,115,116],"reinforcement-learning","deep-reinforcement-learning","markov-chain","temporal-differencing-learning","sarsa","q-learning","actor-critic","multi-armed-bandit","inverted-pendulum","mountain-car","drone-landing","genetic-algorithm","neural-networks","2026-03-27T02:49:30.150509","2026-04-06T07:13:07.465578",[120,125,130,135,140,145],{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},11357,"为什么清洁机器人示例中，执行一个动作后会有三个可能的后续状态？","这是因为环境包含随机性成分。你期望执行的动作（例如向上）只有 80% 的概率成功发生，同时有 10% 的概率向左偏离，另有 10% 的概率向右偏离。因此，对于每个可能的动作，图像中显示了三种可能的结果。这种随机行为在许多环境中都存在，就像司机想左转，但车子可能会打滑或无法转向一样。","https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning\u002Fissues\u002F14",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},11358,"如何为自定义大小（如 11x11）的网格世界创建转移矩阵？","你可以使用 GridWorld 类并指定行数和列数来定义网格世界。代码如下：\n```python\nfrom gridworld import GridWorld\nenv = GridWorld(tot_row=11, tot_col=11)\n```\n随后，你可以使用该类提供的方法来设置奖励矩阵、转移矩阵和状态矩阵。具体方法细节请查看 gridworld.py 源代码。","https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning\u002Fissues\u002F13",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},11359,"在多臂老虎机的贪婪代理代码中，为什么找到最大奖励后要使用 np.random.choice 而不是直接取 argmax？","这是为了在多个手臂具有相同最高奖励时打破平局（Tie-breaking）。代码首先找到最大奖励值，然后找出所有具有该最大值的索引。如果存在多个这样的手臂，np.random.choice 会从中随机选择一个，以确保选择的公平性，而不是总是选择索引最小的那个。","https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning\u002Fissues\u002F12",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},11360,"如何在没有 Numpy 的微控制器（如 Pyboard 或 OpenMV）上运行此代码？","你可以用列表（lists）或其他原生数据结构替换 Numpy。原代码中 Numpy 主要用于元素级矩阵加法和矩阵与标量的乘法，你可以自行实现这两个操作函数。但需注意，微控制器硬件有限，收敛可能需要很长时间。建议在高性能工作站上计算出最优策略，然后将策略加载到微控制器中使用。","https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning\u002Fissues\u002F1",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},11361,"运行 Montecarlo_control.py 时出现索引错误，提示接收到了 float 类型的行索引而非 int 类型，如何解决？","这是一个已修复的 Bug。问题出在代码第 157 和 158 行，需要将相关变量强制转换为整数（int）。请从仓库下载更新后的文件以解决此问题。","https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning\u002Fissues\u002F7",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},11362,"博客文章中的策略迭代算法代码是否存在拼写错误或多余参数？","是的，之前存在一个小错误。函数 return_expected_action 不需要参数 p。正确的函数定义应为 `def return_expected_action(u, T, v):`。内部逻辑是通过计算每个动作的预期效用并返回最大值的索引来确定动作。该错误已在网站上修复。","https:\u002F\u002Fgithub.com\u002Fmpatacchiola\u002Fdissecting-reinforcement-learning\u002Fissues\u002F2",[]]