[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-rail-berkeley--softlearning":3,"tool-rail-berkeley--softlearning":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",159636,2,"2026-04-17T23:33:34",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":92,"env_os":93,"env_gpu":94,"env_ram":95,"env_deps":96,"category_tags":109,"github_topics":110,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":117,"updated_at":118,"faqs":119,"releases":148},8857,"rail-berkeley\u002Fsoftlearning","softlearning","Softlearning is a reinforcement learning framework for training maximum entropy policies in continuous domains. Includes the official implementation of the Soft Actor-Critic algorithm.","Softlearning 是一个专为连续控制领域设计的深度强化学习框架，核心目标是训练基于“最大熵”策略的智能体。它包含了著名的软演员 - 评论家（SAC）算法的官方实现，有效解决了传统强化学习在复杂连续动作空间中探索效率低、策略稳定性差的难题，帮助智能体在不确定性环境中做出更鲁棒的决策。\n\n该工具主要面向强化学习研究人员和 AI 开发者，特别适合需要复现前沿算法或进行大规模实验的用户。Softlearning 的技术亮点在于其高效的工程架构：底层基于 TensorFlow 和 tf.keras 构建模型，同时深度集成 Ray 生态系统。通过利用 Ray Tune 和 Autoscaler，用户可以将本地原型代码无缝迁移至云端（如 AWS 或 GCP），实现实验的智能并行化与分布式训练，极大提升了资源利用率和研发效率。虽然配置环境需要一定的技术基础（如安装 MuJoCo 物理引擎），但其清晰的模块化设计为算法研究与验证提供了坚实可靠的基础设施。","# Softlearning\n\nSoftlearning is a deep reinforcement learning toolbox for training maximum entropy policies in continuous domains. The implementation is fairly thin and primarily optimized for our own development purposes. It utilizes the tf.keras modules for most of the model classes (e.g. policies and value functions). We use Ray for the experiment orchestration. Ray Tune and Autoscaler implement several neat features that enable us to seamlessly run the same experiment scripts that we use for local prototyping to launch large-scale experiments on any chosen cloud service (e.g. GCP or AWS), and intelligently parallelize and distribute training for effective resource allocation.\n\nThis implementation uses Tensorflow. For a PyTorch implementation of soft actor-critic, take a look at [rlkit](https:\u002F\u002Fgithub.com\u002Fvitchyr\u002Frlkit).\n\n# Getting Started\n\n## Prerequisites\n\nThe environment can be run either locally using conda or inside a docker container. For conda installation, you need to have [Conda](https:\u002F\u002Fconda.io\u002Fdocs\u002Fuser-guide\u002Finstall\u002Findex.html) installed. For docker installation you will need to have [Docker](https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Finstallation\u002F) and [Docker Compose](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Finstall\u002F) installed. Also, most of our environments currently require a [MuJoCo](https:\u002F\u002Fwww.roboti.us\u002Flicense.html) license.\n\n## Conda Installation\n\n1. [Download](https:\u002F\u002Fwww.roboti.us\u002Findex.html) and install MuJoCo 1.50 and 2.00 from the MuJoCo website. We assume that the MuJoCo files are extracted to the default location (`~\u002F.mujoco\u002Fmjpro150` and `~\u002F.mujoco\u002Fmujoco200_{platform}`). Unfortunately, `gym` and `dm_control` expect different paths for MuJoCo 2.00 installation, which is why you will need to have it installed both in `~\u002F.mujoco\u002Fmujoco200_{platform}` and `~\u002F.mujoco\u002Fmujoco200`. The easiest way is to create a symlink from `~\u002F.mujoco\u002Fmujoco200_{plaftorm}` -> `~\u002F.mujoco\u002Fmujoco200` with: `ln -s ~\u002F.mujoco\u002Fmujoco200_{platform} ~\u002F.mujoco\u002Fmujoco200`.\n\n2. Copy your MuJoCo license key (mjkey.txt) to ~\u002F.mujoco\u002Fmjkey.txt:\n\n3. Clone `softlearning`\n```\ngit clone https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning.git ${SOFTLEARNING_PATH}\n```\n\n4. Create and activate conda environment, install softlearning to enable command line interface.\n```\ncd ${SOFTLEARNING_PATH}\nconda env create -f environment.yml\nconda activate softlearning\npip install -e ${SOFTLEARNING_PATH}\n```\n\nThe environment should be ready to run. See examples section for examples of how to train and simulate the agents.\n\nFinally, to deactivate and remove the conda environment:\n```\nconda deactivate\nconda remove --name softlearning --all\n```\n\n## Docker Installation\n\n### docker-compose\nTo build the image and run the container:\n```\nexport MJKEY=\"$(cat ~\u002F.mujoco\u002Fmjkey.txt)\" \\\n    && docker-compose \\\n        -f .\u002Fdocker\u002Fdocker-compose.dev.cpu.yml \\\n        up \\\n        -d \\\n        --force-recreate\n```\n\nYou can access the container with the typical Docker [exec](https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Freference\u002Fcommandline\u002Fexec\u002F)-command, i.e.\n\n```\ndocker exec -it softlearning bash\n```\n\nSee examples section for examples of how to train and simulate the agents.\n\nFinally, to clean up the docker setup:\n```\ndocker-compose \\\n    -f .\u002Fdocker\u002Fdocker-compose.dev.cpu.yml \\\n    down \\\n    --rmi all \\\n    --volumes\n```\n\n## Examples\n### Training and simulating an agent\n1. To train the agent\n```\nsoftlearning run_example_local examples.development \\\n    --algorithm SAC \\\n    --universe gym \\\n    --domain HalfCheetah \\\n    --task v3 \\\n    --exp-name my-sac-experiment-1 \\\n    --checkpoint-frequency 1000  # Save the checkpoint to resume training later\n```\n\n2. To simulate the resulting policy:\nFirst, find the *absolute* path that the checkpoint is saved to. By default (i.e. without specifying the `log-dir` argument to the previous script), the data is saved under `~\u002Fray_results\u002F\u003Cuniverse>\u002F\u003Cdomain>\u002F\u003Ctask>\u002F\u003Cdatatimestamp>-\u003Cexp-name>\u002F\u003Ctrial-id>\u002F\u003Ccheckpoint-id>`. For example: `~\u002Fray_results\u002Fgym\u002FHalfCheetah\u002Fv3\u002F2018-12-12T16-48-37-my-sac-experiment-1-0\u002Fmujoco-runner_0_seed=7585_2018-12-12_16-48-37xuadh9vd\u002Fcheckpoint_1000\u002F`. The next command assumes that this path is found from `${SAC_CHECKPOINT_DIR}` environment variable.\n\n```\npython -m examples.development.simulate_policy \\\n    ${SAC_CHECKPOINT_DIR} \\\n    --max-path-length 1000 \\\n    --num-rollouts 1 \\\n    --render-kwargs '{\"mode\": \"human\"}'\n```\n\n`examples.development.main` contains several different environments and there are more example scripts available in the  `\u002Fexamples` folder. For more information about the agents and configurations, run the scripts with `--help` flag: `python .\u002Fexamples\u002Fdevelopment\u002Fmain.py --help`\n```\noptional arguments:\n  -h, --help            show this help message and exit\n  --universe {robosuite,dm_control,gym}\n  --domain DOMAIN\n  --task TASK\n  --checkpoint-replay-pool CHECKPOINT_REPLAY_POOL\n                        Whether a checkpoint should also saved the replay\n                        pool. If set, takes precedence over\n                        variant['run_params']['checkpoint_replay_pool']. Note\n                        that the replay pool is saved (and constructed) piece\n                        by piece so that each experience is saved only once.\n  --algorithm ALGORITHM\n  --policy {gaussian}\n  --exp-name EXP_NAME\n  --mode MODE\n  --run-eagerly RUN_EAGERLY\n                        Whether to run tensorflow in eager mode.\n  --local-dir LOCAL_DIR\n                        Destination local folder to save training results.\n  --confirm-remote [CONFIRM_REMOTE]\n                        Whether or not to query yes\u002Fno on remote run.\n  --video-save-frequency VIDEO_SAVE_FREQUENCY\n                        Save frequency for videos.\n  --cpus CPUS           Cpus to allocate to ray process. Passed to `ray.init`.\n  --gpus GPUS           Gpus to allocate to ray process. Passed to `ray.init`.\n  --resources RESOURCES\n                        Resources to allocate to ray process. Passed to\n                        `ray.init`.\n  --include-webui INCLUDE_WEBUI\n                        Boolean flag indicating whether to start theweb UI,\n                        which is a Jupyter notebook. Passed to `ray.init`.\n  --temp-dir TEMP_DIR   If provided, it will specify the root temporary\n                        directory for the Ray process. Passed to `ray.init`.\n  --resources-per-trial RESOURCES_PER_TRIAL\n                        Resources to allocate for each trial. Passed to\n                        `tune.run`.\n  --trial-cpus TRIAL_CPUS\n                        CPUs to allocate for each trial. Note: this is only\n                        used for Ray's internal scheduling bookkeeping, and is\n                        not an actual hard limit for CPUs. Passed to\n                        `tune.run`.\n  --trial-gpus TRIAL_GPUS\n                        GPUs to allocate for each trial. Note: this is only\n                        used for Ray's internal scheduling bookkeeping, and is\n                        not an actual hard limit for GPUs. Passed to\n                        `tune.run`.\n  --trial-extra-cpus TRIAL_EXTRA_CPUS\n                        Extra CPUs to reserve in case the trials need to\n                        launch additional Ray actors that use CPUs.\n  --trial-extra-gpus TRIAL_EXTRA_GPUS\n                        Extra GPUs to reserve in case the trials need to\n                        launch additional Ray actors that use GPUs.\n  --num-samples NUM_SAMPLES\n                        Number of times to repeat each trial. Passed to\n                        `tune.run`.\n  --upload-dir UPLOAD_DIR\n                        Optional URI to sync training results to (e.g.\n                        s3:\u002F\u002F\u003Cbucket> or gs:\u002F\u002F\u003Cbucket>). Passed to `tune.run`.\n  --trial-name-template TRIAL_NAME_TEMPLATE\n                        Optional string template for trial name. For example:\n                        '{trial.trial_id}-seed={trial.config[run_params][seed]\n                        }' Passed to `tune.run`.\n  --checkpoint-frequency CHECKPOINT_FREQUENCY\n                        How many training iterations between checkpoints. A\n                        value of 0 (default) disables checkpointing. If set,\n                        takes precedence over\n                        variant['run_params']['checkpoint_frequency']. Passed\n                        to `tune.run`.\n  --checkpoint-at-end CHECKPOINT_AT_END\n                        Whether to checkpoint at the end of the experiment. If\n                        set, takes precedence over\n                        variant['run_params']['checkpoint_at_end']. Passed to\n                        `tune.run`.\n  --max-failures MAX_FAILURES\n                        Try to recover a trial from its last checkpoint at\n                        least this many times. Only applies if checkpointing\n                        is enabled. Passed to `tune.run`.\n  --restore RESTORE     Path to checkpoint. Only makes sense to set if running\n                        1 trial. Defaults to None. Passed to `tune.run`.\n  --server-port SERVER_PORT\n                        Port number for launching TuneServer. Passed to\n                        `tune.run`.\n```\n\n### Resume training from a saved checkpoint\n\n## This feature is currently broken!\n\nIn order to resume training from previous checkpoint, run the original example main-script, with an additional `--restore` flag. For example, the previous example can be resumed as follows:\n\n```\nsoftlearning run_example_local examples.development \\\n    --algorithm SAC \\\n    --universe gym \\\n    --domain HalfCheetah \\\n    --task v3 \\\n    --exp-name my-sac-experiment-1 \\\n    --checkpoint-frequency 1000 \\\n    --restore ${SAC_CHECKPOINT_PATH}\n```\n\n# References\nThe algorithms are based on the following papers:\n\n*Soft Actor-Critic Algorithms and Applications*.\u003C\u002Fbr>\nTuomas Haarnoja*, Aurick Zhou*, Kristian Hartikainen*, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine.\narXiv preprint, 2018.\u003C\u002Fbr>\n[paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1812.05905)  |  [videos](https:\u002F\u002Fsites.google.com\u002Fview\u002Fsac-and-applications)\n\n*Latent Space Policies for Hierarchical Reinforcement Learning*.\u003C\u002Fbr>\nTuomas Haarnoja*, Kristian Hartikainen*, Pieter Abbeel, and Sergey Levine.\nInternational Conference on Machine Learning (ICML), 2018.\u003C\u002Fbr>\n[paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.02808) | [videos](https:\u002F\u002Fsites.google.com\u002Fview\u002Flatent-space-deep-rl)\n\n*Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor*.\u003C\u002Fbr>\nTuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine.\nInternational Conference on Machine Learning (ICML), 2018.\u003C\u002Fbr>\n[paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1801.01290) | [videos](https:\u002F\u002Fsites.google.com\u002Fview\u002Fsoft-actor-critic)\n\n*Composable Deep Reinforcement Learning for Robotic Manipulation*.\u003C\u002Fbr>\nTuomas Haarnoja, Vitchyr Pong, Aurick Zhou, Murtaza Dalal, Pieter Abbeel, Sergey Levine.\nInternational Conference on Robotics and Automation (ICRA), 2018.\u003C\u002Fbr>\n[paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1803.06773) | [videos](https:\u002F\u002Fsites.google.com\u002Fview\u002Fcomposing-real-world-policies)\n\n*Reinforcement Learning with Deep Energy-Based Policies*.\u003C\u002Fbr>\nTuomas Haarnoja*, Haoran Tang*, Pieter Abbeel, Sergey Levine.\nInternational Conference on Machine Learning (ICML), 2017.\u003C\u002Fbr>\n[paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1702.08165) | [videos](https:\u002F\u002Fsites.google.com\u002Fview\u002Fsoftqlearning\u002Fhome)\n\nIf Softlearning helps you in your academic research, you are encouraged to cite our paper. Here is an example bibtex:\n```\n@techreport{haarnoja2018sacapps,\n  title={Soft Actor-Critic Algorithms and Applications},\n  author={Tuomas Haarnoja and Aurick Zhou and Kristian Hartikainen and George Tucker and Sehoon Ha and Jie Tan and Vikash Kumar and Henry Zhu and Abhishek Gupta and Pieter Abbeel and Sergey Levine},\n  journal={arXiv preprint arXiv:1812.05905},\n  year={2018}\n}\n```\n","# 软学习\n\n软学习是一个用于在连续域中训练最大熵策略的深度强化学习工具箱。该实现较为精简，主要为我们自身的开发目的而优化。它使用 `tf.keras` 模块来实现大多数模型类（例如策略和价值函数）。我们使用 Ray 进行实验编排。Ray Tune 和 Autoscaler 实现了多项便捷功能，使我们能够无缝地将本地原型设计时使用的实验脚本部署到任何选定的云服务（如 GCP 或 AWS）上，以运行大规模实验，并智能地并行化和分布式训练，从而实现高效的资源分配。\n\n此实现使用 TensorFlow。若需 PyTorch 版本的软演员-评论家算法，请参阅 [rlkit](https:\u002F\u002Fgithub.com\u002Fvitchyr\u002Frlkit)。\n\n# 入门指南\n\n## 前置条件\n\n该环境既可以在本地通过 Conda 运行，也可以在 Docker 容器内运行。对于 Conda 安装，您需要先安装 [Conda](https:\u002F\u002Fconda.io\u002Fdocs\u002Fuser-guide\u002Finstall\u002Findex.html)。对于 Docker 安装，您需要安装 [Docker](https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Finstallation\u002F) 和 [Docker Compose](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Finstall\u002F)。此外，目前我们的大多数环境都需要 [MuJoCo](https:\u002F\u002Fwww.roboti.us\u002Flicense.html) 许可证。\n\n## Conda 安装\n\n1. 从 MuJoCo 官网 [下载](https:\u002F\u002Fwww.roboti.us\u002Findex.html) 并安装 MuJoCo 1.50 和 2.00。我们假设 MuJoCo 文件已解压到默认位置（`~\u002F.mujoco\u002Fmjpro150` 和 `~\u002F.mujoco\u002Fmujoco200_{platform}`）。遗憾的是，`gym` 和 `dm_control` 对 MuJoCo 2.00 的安装路径要求不同，因此您需要同时将其安装在 `~\u002F.mujoco\u002Fmujoco200_{platform}` 和 `~\u002F.mujoco\u002Fmujoco200` 目录下。最简单的方法是创建一个符号链接：`ln -s ~\u002F.mujoco\u002Fmujoco200_{plaftorm} ~\u002F.mujoco\u002Fmujoco200`。\n\n2. 将您的 MuJoCo 许可证密钥文件（mjkey.txt）复制到 `~\u002F.mujoco\u002Fmjkey.txt`：\n\n3. 克隆 `softlearning`：\n```\ngit clone https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning.git ${SOFTLEARNING_PATH}\n```\n\n4. 创建并激活 Conda 环境，安装 softlearning 以启用命令行界面。\n```\ncd ${SOFTLEARNING_PATH}\nconda env create -f environment.yml\nconda activate softlearning\npip install -e ${SOFTLEARNING_PATH}\n```\n\n至此，环境应已准备就绪。请参阅“示例”部分，了解如何训练和模拟智能体的示例。\n\n最后，要停用并移除 Conda 环境：\n```\nconda deactivate\nconda remove --name softlearning --all\n```\n\n## Docker 安装\n\n### docker-compose\n构建镜像并运行容器：\n```\nexport MJKEY=\"$(cat ~\u002F.mujoco\u002Fmjkey.txt)\" \\\n    && docker-compose \\\n        -f .\u002Fdocker\u002Fdocker-compose.dev.cpu.yml \\\n        up \\\n        -d \\\n        --force-recreate\n```\n\n您可以使用标准的 Docker [exec](https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Freference\u002Fcommandline\u002Fexec\u002F) 命令进入容器，例如：\n```\ndocker exec -it softlearning bash\n```\n\n请参阅“示例”部分，了解如何训练和模拟智能体的示例。\n\n最后，清理 Docker 设置：\n```\ndocker-compose \\\n    -f .\u002Fdocker\u002Fdocker-compose.dev.cpu.yml \\\n    down \\\n    --rmi all \\\n    --volumes\n```\n\n## 示例\n\n### 训练与模拟智能体\n1. 训练智能体：\n```\nsoftlearning run_example_local examples.development \\\n    --algorithm SAC \\\n    --universe gym \\\n    --domain HalfCheetah \\\n    --task v3 \\\n    --exp-name my-sac-experiment-1 \\\n    --checkpoint-frequency 1000  # 每1000步保存一次检查点，以便后续恢复训练\n```\n\n2. 模拟得到的策略：\n首先，找到检查点保存的*绝对*路径。默认情况下（即未指定 `log-dir` 参数时），数据会保存在 `~\u002Fray_results\u002F\u003Cuniverse>\u002F\u003Cdomain>\u002F\u003Ctask>\u002F\u003Cdatatimestamp>-\u003Cexp-name>\u002F\u003Ctrial-id>\u002F\u003Ccheckpoint-id>` 目录下。例如：`~\u002Fray_results\u002Fgym\u002FHalfCheetah\u002Fv3\u002F2018-12-12T16-48-37-my-sac-experiment-1-0\u002Fmujoco-runner_0_seed=7585_2018-12-12_16-48-37xuadh9vd\u002Fcheckpoint_1000\u002F`。接下来的命令假设该路径已通过环境变量 `${SAC_CHECKPOINT_DIR}` 获取。\n\n```\npython -m examples.development.simulate_policy \\\n    ${SAC_CHECKPOINT_DIR} \\\n    --max-path-length 1000 \\\n    --num-rollouts 1 \\\n    --render-kwargs '{\"mode\": \"human\"}'\n```\n\n`examples.development.main` 包含多个不同的环境，并且 `\u002Fexamples` 文件夹中还有更多示例脚本。如需了解更多关于智能体和配置的信息，可在运行脚本时添加 `--help` 标志：`python .\u002Fexamples\u002Fdevelopment\u002Fmain.py --help`。\n```\n可选参数：\n  -h, --help            显示帮助信息并退出\n  --universe {robosuite,dm_control,gym}\n  --domain DOMAIN\n  --task TASK\n  --checkpoint-replay-pool CHECKPOINT_REPLAY_POOL\n                        是否将回放缓冲区一同保存为检查点。若设置，则优先于 variant['run_params']['checkpoint_replay_pool']。请注意，回放缓冲区是逐步保存（并构建）的，因此每条经验仅被保存一次。\n  --algorithm ALGORITHM\n  --policy {gaussian}\n  --exp-name EXP_NAME\n  --mode MODE\n  --run-eagerly RUN_EAGERLY\n                        是否以 eager 模式运行 TensorFlow。\n  --local-dir LOCAL_DIR\n                        用于保存训练结果的本地目标文件夹。\n  --confirm-remote [CONFIRM_REMOTE]\n                        远程运行时是否提示确认。\n  --video-save-frequency VIDEO_SAVE_FREQUENCY\n                        视频保存频率。\n  --cpus CPUS           分配给 Ray 进程的 CPU 数量。传递给 `ray.init`。\n  --gpus GPUS           分配给 Ray 进程的 GPU 数量。传递给 `ray.init`。\n  --resources RESOURCES\n                        分配给 Ray 进程的资源。传递给 `ray.init`。\n  --include-webui INCLUDE_WEBUI\n                        布尔标志，指示是否启动 Web UI（即 Jupyter Notebook）。传递给 `ray.init`。\n  --temp-dir TEMP_DIR   若提供，则指定 Ray 进程的根临时目录。传递给 `ray.init`。\n  --resources-per-trial RESOURCES_PER_TRIAL\n                        每次试验分配的资源。传递给 `tune.run`。\n  --trial-cpus TRIAL_CPUS\n                        每次试验分配的 CPU 数量。注意：这仅用于 Ray 的内部调度管理，而非实际的 CPU 硬性限制。传递给 `tune.run`。\n  --trial-gpus TRIAL_GPUS\n                        每次试验分配的 GPU 数量。同样，这仅用于 Ray 的内部调度管理，而非实际的 GPU 硬性限制。传递给 `tune.run`。\n  --trial-extra-cpus TRIAL_EXTRA_CPUS\n                        预留的额外 CPU，以备试验需要启动使用 CPU 的其他 Ray Actor 时使用。\n  --trial-extra-gpus TRIAL_EXTRA_GPUS\n                        预留的额外 GPU，以备试验需要启动使用 GPU 的其他 Ray Actor 时使用。\n  --num-samples NUM_SAMPLES\n                        每次试验重复执行的次数。传递给 `tune.run`。\n  --upload-dir UPLOAD_DIR\n                        可选的 URI 地址，用于将训练结果同步到远程存储（例如 s3:\u002F\u002F\u003Cbucket> 或 gs:\u002F\u002F\u003Cbucket>)。传递给 `tune.run`。\n  --trial-name-template TRIAL_NAME_TEMPLATE\n                        试验名称的可选模板字符串。例如：'{trial.trial_id}-seed={trial.config[run_params][seed]}'。传递给 `tune.run`。\n  --checkpoint-frequency CHECKPOINT_FREQUENCY\n                        检查点之间的训练迭代次数。值为 0（默认）时表示禁用检查点保存。若设置，则优先于 variant['run_params']['checkpoint_frequency']。传递给 `tune.run`。\n  --checkpoint-at-end CHECKPOINT_AT_END\n                        是否在实验结束时保存检查点。若设置，则优先于 variant['run_params']['checkpoint_at_end']。传递给 `tune.run`。\n  --max-failures MAX_FAILURES\n                        尝试从上次检查点恢复试验的最大次数。仅在启用检查点保存时生效。传递给 `tune.run`。\n  --restore RESTORE     检查点路径。仅在运行单个试验时有意义。默认为 None。传递给 `tune.run`。\n  --server-port SERVER_PORT\n                        用于启动 TuneServer 的端口号。传递给 `tune.run`。\n```\n\n### 从已保存的检查点恢复训练\n\n## 此功能目前存在缺陷！\n\n要从之前的检查点恢复训练，需运行原始示例主脚本，并添加 `--restore` 标志。例如，可以按如下方式恢复之前的示例：\n\n```\nsoftlearning run_example_local examples.development \\\n    --algorithm SAC \\\n    --universe gym \\\n    --domain HalfCheetah \\\n    --task v3 \\\n    --exp-name my-sac-experiment-1 \\\n    --checkpoint-frequency 1000 \\\n    --restore ${SAC_CHECKPOINT_PATH}\n```\n\n# 参考文献\n这些算法基于以下论文：\n\n*软演员-评论家算法及其应用*。\u003C\u002Fbr>\n图奥马斯·哈尔诺亚*、奥里克·周*、克里斯蒂安·哈蒂凯宁*、乔治·塔克尔、世勋·哈、杰·谭、维卡什·库马尔、亨利·朱、阿比谢克·古普塔、皮特·阿贝尔和谢尔盖·列文。\narXiv 预印本，2018年。\u003C\u002Fbr>\n[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1812.05905)  |  [视频](https:\u002F\u002Fsites.google.com\u002Fview\u002Fsac-and-applications)\n\n*用于层次强化学习的潜在空间策略*。\u003C\u002Fbr>\n图奥马斯·哈尔诺亚*、克里斯蒂安·哈蒂凯宁*、皮特·阿贝尔和谢尔盖·列文。\n国际机器学习会议（ICML），2018年。\u003C\u002Fbr>\n[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.02808) | [视频](https:\u002F\u002Fsites.google.com\u002Fview\u002Flatent-space-deep-rl)\n\n*软演员-评论家：带有随机演员的离策略最大熵深度强化学习*。\u003C\u002Fbr>\n图奥马斯·哈尔诺亚、奥里克·周、皮特·阿贝尔和谢尔盖·列文。\n国际机器学习会议（ICML），2018年。\u003C\u002Fbr>\n[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1801.01290) | [视频](https:\u002F\u002Fsites.google.com\u002Fview\u002Fsoft-actor-critic)\n\n*用于机器人操作的可组合深度强化学习*。\u003C\u002Fbr>\n图奥马斯·哈尔诺亚、维奇尔·庞格、奥里克·周、穆尔塔扎·达拉尔、皮特·阿贝尔、谢尔盖·列文。\n国际机器人与自动化会议（ICRA），2018年。\u003C\u002Fbr>\n[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1803.06773) | [视频](https:\u002F\u002Fsites.google.com\u002Fview\u002Fcomposing-real-world-policies)\n\n*基于深度能量函数策略的强化学习*。\u003C\u002Fbr>\n图奥马斯·哈尔诺亚*、唐浩然*、皮特·阿贝尔、谢尔盖·列文。\n国际机器学习会议（ICML），2017年。\u003C\u002Fbr>\n[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1702.08165) | [视频](https:\u002F\u002Fsites.google.com\u002Fview\u002Fsoftqlearning\u002Fhome)\n\n如果 Softlearning 对您的学术研究有所帮助，请您引用我们的论文。以下是一个 BibTeX 示例：\n```\n@techreport{haarnoja2018sacapps,\n  title={Soft Actor-Critic Algorithms and Applications},\n  author={Tuomas Haarnoja and Aurick Zhou and Kristian Hartikainen and George Tucker and Sehoon Ha and Jie Tan and Vikash Kumar and Henry Zhu and Abhishek Gupta and Pieter Abbeel and Sergey Levine},\n  journal={arXiv preprint arXiv:1812.05905},\n  year={2018}\n}\n```","# Softlearning 快速上手指南\n\nSoftlearning 是一个用于在连续域中训练最大熵策略的深度强化学习工具箱，基于 TensorFlow 和 Ray 构建，核心算法为软演员 - 评论家（SAC）。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux 或 macOS (Windows 需通过 WSL 或 Docker)\n- **Python**: 推荐通过 Conda 管理环境\n- **依赖工具**:\n  - [Conda](https:\u002F\u002Fconda.io\u002F) (推荐) 或 [Docker](https:\u002F\u002Fdocs.docker.com\u002F)\n  - [MuJoCo](https:\u002F\u002Fwww.roboti.us\u002Flicense.html): 大多数环境需要 MuJoCo 1.50 和 2.00 的许可证。\n\n### 前置依赖配置\n在使用前，请确保已下载并安装 MuJoCo，并配置好许可证密钥：\n1. 下载 MuJoCo 1.50 和 2.00 并解压到默认位置 (`~\u002F.mujoco\u002Fmjpro150` 和 `~\u002F.mujoco\u002Fmujoco200_{platform}`)。\n2. 由于 `gym` 和 `dm_control` 对路径要求不同，需创建软链接：\n   ```bash\n   ln -s ~\u002F.mujoco\u002Fmujoco200_{platform} ~\u002F.mujoco\u002Fmujoco200\n   ```\n3. 将许可证文件 `mjkey.txt` 复制到 `~\u002F.mujoco\u002Fmjkey.txt`。\n\n> **提示**：国内用户若下载 MuJoCo 困难，可尝试寻找国内镜像源或联系社区获取资源。\n\n## 安装步骤\n\n推荐使用 **Conda** 方式进行安装，以便更好地管理依赖。\n\n### 方法一：Conda 安装（推荐）\n\n1. **克隆仓库**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning.git ${SOFTLEARNING_PATH}\n   cd ${SOFTLEARNING_PATH}\n   ```\n\n2. **创建并激活环境**\n   ```bash\n   conda env create -f environment.yml\n   conda activate softlearning\n   ```\n\n3. **安装工具包**\n   以可编辑模式安装，以便启用命令行接口：\n   ```bash\n   pip install -e ${SOFTLEARNING_PATH}\n   ```\n\n### 方法二：Docker 安装\n\n如果你偏好容器化部署，可以使用 docker-compose：\n\n```bash\nexport MJKEY=\"$(cat ~\u002F.mujoco\u002Fmjkey.txt)\" \\\n    && docker-compose \\\n        -f .\u002Fdocker\u002Fdocker-compose.dev.cpu.yml \\\n        up \\\n        -d \\\n        --force-recreate\n```\n\n进入容器：\n```bash\ndocker exec -it softlearning bash\n```\n\n## 基本使用\n\n安装完成后，你可以立即开始训练智能体。以下是在 Gym 环境的 HalfCheetah 任务上训练 SAC 算法的最简示例。\n\n### 1. 训练智能体\n\n运行以下命令开始训练，并设置每 1000 次迭代保存一次检查点：\n\n```bash\nsoftlearning run_example_local examples.development \\\n    --algorithm SAC \\\n    --universe gym \\\n    --domain HalfCheetah \\\n    --task v3 \\\n    --exp-name my-sac-experiment-1 \\\n    --checkpoint-frequency 1000\n```\n\n*注：训练结果默认保存在 `~\u002Fray_results\u002F` 目录下。*\n\n### 2. 模拟策略（可视化）\n\n训练完成后，找到生成的检查点绝对路径（例如：`~\u002Fray_results\u002Fgym\u002FHalfCheetah\u002Fv3\u002F...\u002Fcheckpoint_1000\u002F`），将其赋值给环境变量 `${SAC_CHECKPOINT_DIR}`，然后运行：\n\n```bash\npython -m examples.development.simulate_policy \\\n    ${SAC_CHECKPOINT_DIR} \\\n    --max-path-length 1000 \\\n    --num-rollouts 1 \\\n    --render-kwargs '{\"mode\": \"human\"}'\n```\n\n这将弹出一个窗口展示训练好的智能体在环境中的表现。\n\n### 更多选项\n\n查看完整的参数配置帮助信息：\n```bash\npython .\u002Fexamples\u002Fdevelopment\u002Fmain.py --help\n```\n\n支持指定 GPU\u002FCPU 资源、上传结果到云存储（S3\u002FGCS）、调整采样次数等高级功能。","某机器人实验室的研究团队正在训练一只四足机器人在复杂地形上实现稳定且灵活的奔跑，需要智能体在连续动作空间中探索多样化的运动策略。\n\n### 没有 softlearning 时\n- **算法复现成本高**：团队需从零编写最大熵强化学习（如 SAC）的核心代码，极易出现数学公式实现偏差，导致策略收敛困难。\n- **实验扩展性差**：本地单机训练速度缓慢，缺乏类似 Ray 的原生集成，难以将实验无缝迁移到 AWS 或 GCP 等云端进行大规模并行训练。\n- **策略探索不足**：传统确定性策略容易陷入局部最优，生成的步态单一僵硬，无法应对突发的地面打滑或不平整干扰。\n- **环境配置繁琐**：MuJoCo 物理引擎与深度学习框架的依赖关系复杂，手动配置 Docker 或 Conda 环境常因路径问题导致运行失败。\n\n### 使用 softlearning 后\n- **开箱即用官方实现**：直接调用内置的 SAC 算法模块，基于 tf.keras 构建策略网络，确保理论实现的准确性，大幅缩短研发周期。\n- **弹性分布式训练**：利用集成的 Ray Tune 和 Autoscaler，同一套脚本即可在本地原型验证后，自动扩展至云端集群，显著加速迭代过程。\n- **鲁棒性显著提升**：最大熵策略鼓励智能体在保持高性能的同时最大化行为熵，使机器人学会了更多样化的备用步态，抗干扰能力增强。\n- **标准化部署流程**：通过提供的 Docker Compose 配置文件，一键解决 MuJoCo 许可证及依赖路径问题，团队成员可快速复用统一的开发环境。\n\nsoftlearning 通过提供工业级的分布式架构与标准的最大熵算法实现，让研究团队能从繁琐的工程基建中解脱，专注于提升机器人控制策略的鲁棒性与适应性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Frail-berkeley_softlearning_28c07431.png","rail-berkeley","Robotic AI & Learning Lab Berkeley","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Frail-berkeley_b4841e30.jpg","",null,"http:\u002F\u002Frail.eecs.berkeley.edu\u002F","https:\u002F\u002Fgithub.com\u002Frail-berkeley",[80,84],{"name":81,"color":82,"percentage":83},"Python","#3572A5",99.4,{"name":85,"color":86,"percentage":87},"Shell","#89e051",0.6,1420,250,"2026-04-17T01:12:26","NOASSERTION",4,"Linux, macOS","未说明（支持通过 Ray 分配 GPU 资源，具体取决于实验规模）","未说明",{"notes":97,"python":98,"dependencies":99},"该工具主要用于连续域下的最大熵强化学习。必须拥有 MuJoCo 许可证并正确配置路径（需同时兼容 gym 和 dm_control 的路径要求，通常需创建软链接）。支持本地 Conda 环境或 Docker 容器运行。利用 Ray 进行实验编排，可无缝扩展至云端（如 GCP 或 AWS）进行大规模分布式训练。注意：README 中提到从检查点恢复训练的功能当前已损坏。若需 PyTorch 版本，请参考 rlkit。","未说明（需通过 environment.yml 创建 Conda 环境）",[100,101,102,103,104,105,106,107,108],"TensorFlow","tf.keras","Ray","Ray Tune","MuJoCo (1.50 & 2.00)","gym","dm_control","Docker","Docker Compose",[14],[111,112,113,114,115,116],"reinforcement-learning","soft-actor-critic","deep-learning","deep-reinforcement-learning","deep-neural-networks","machine-learning","2026-03-27T02:49:30.150509","2026-04-18T14:13:16.161553",[120,125,130,135,139,143],{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},39748,"SAC 中的温度系数 alpha 在训练期间大于 1 是否正常？","是正常的。Alpha（温度系数）的值取决于奖励的尺度（reward scale）。\n对于连续动作空间，合理的熵值范围可以是 `(-inf, action_dim * log(2)]`。由于 alpha 需要平衡奖励和熵，如果环境奖励值较大，alpha 完全可能增长到 1 以上甚至更高（例如 1000），这取决于具体的任务设定和初始化。","https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning\u002Fissues\u002F149",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},39744,"为什么无法复现 HalfCheetah-v2 环境的论文结果？","问题通常源于 Gym 环境有两个独立的随机种子：一个在创建环境时设置，另一个是 `env.action_space` 的种子。后者负责 `env.action_space.sample()` 生成的随机动作。在许多 Gym 版本中，action_space 的种子默认可能不同或始终为 0。\n解决方案：在创建环境后，手动设置 action_space 的种子。例如，在 `GymAdapter` 类中添加以下代码：\n```python\nenv = gym.envs.make(env_id, **kwargs)\nenv.action_space.seed(0) # 或者设置为与主种子相同的值\n```\n确保同时设置了 `env.seed()` 和 `env.action_space.seed()` 即可复现结果。","https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning\u002Fissues\u002F75",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},39745,"遇到 'module gym has no attribute register' 错误怎么办？","该错误通常表示安装的 Gym 版本过旧或不兼容。\n解决方案有两种：\n1. **升级 Gym**：维护者建议升级 Gym 到最新版本。\n2. **修改代码调用**：如果无法立即升级，可以将代码中的 `gym.register` 修改为 `gym.envs.register`。","https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning\u002Fissues\u002F88",{"id":136,"question_zh":137,"answer_zh":138,"source_url":124},39746,"SAC 算法中 target_entropy 为什么要初始化为与 action_dim 相关？可以设为固定值吗？","理论上可以设置为硬编码的固定值（如 0.1），但在实践中，启发式方法通常将其设为 `-dim(A)`（动作空间的维度）。\n这是因为动作空间维度越高，策略可能产生的熵值上限就越高。为了保持探索能力与动作空间大小相匹配，目标熵应随维度增加而调整（绝对值变大）。如果设为固定小值，高维动作空间可能难以达到该目标，导致温度系数（alpha）异常。",{"id":140,"question_zh":141,"answer_zh":142,"source_url":124},39747,"训练过程中熵值有时会低于 target_entropy，这是否意味着代码实现有误？","不一定代表代码错误。在使用函数近似（如神经网络）的强化学习中，实际的状态 - 动作对熵值可能会暂时低于 `target_entropy`。\n`target_entropy` 是一个期望的阈值，用于调节温度系数 alpha，而不是每一时刻必须严格满足的硬性约束。只要整体趋势符合预期且算法收敛，局部的波动是正常的。",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},39749,"SAC 自动熵温度调节（alpha loss）的实现与论文公式不一致，是 Bug 吗？","这不是 Bug，而是为了实现数值稳定性的常用技巧。\n虽然论文公式中直接优化 alpha，但在代码实现中通常优化 `log_alpha`（即对 alpha 取对数）。\n这样做的原因是：alpha 必须为正数，直接优化 alpha 可能需要复杂的约束处理。通过优化 `log_alpha`，可以利用指数函数 `exp(log_alpha)` 自动保证 alpha 始终为正，且梯度传播效果相同。代码中看到的 `log_alpha` 和相关符号变化是为了适配这种参数化方式。","https:\u002F\u002Fgithub.com\u002Frail-berkeley\u002Fsoftlearning\u002Fissues\u002F163",[]]