Open
Conversation
详细修改: 1. online_adapter.py: - 添加输入action的NaN检测和处理 - 添加reward、cost、obs的NaN防护 - 添加异常处理包装 2. ppo_lag.py: - 修复cost_limit断言条件 - 改进梯度计算的数值稳定性 - 修复拉格朗日乘子更新逻辑 3. policy_gradient.py: - 优化梯度计算流程 - 改进数值稳定性 4. onpolicy_adapter.py: - 同步相关适配器修改 这些修改解决了训练过程中出现的NaN值和断言失败问题,提高了算法的鲁棒性。
- reproduce_nan_issue.py: 用于复现和调试PPO-Lagrange中的NaN值问题 - train_with_risk.py: 对比实验脚本,支持风险敏感安全强化学习训练
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
修复了 PPO-Lagrange 算法在训练过程中出现的 NaN 值和断言失败问题。
修改内容
online_adapter.py:
ppo_lag.py:
policy_gradient.py:
onpolicy_adapter.py:
新增脚本:
reproduce_nan_issue.py: NaN 问题复现和调试脚本train_with_risk.py: 风险敏感训练对比实验脚本测试验证
影响范围
这些修改主要影响: