Conversation
…ReplayBuffer Added epsilons to prevent division by zero during the calculation of probabilities and importance sampling weights in `PrioritizedReplayBuffer.sample()`. This addresses RuntimeWarnings for division by zero and invalid values, which were causing the average loss to become NaN during training.
- Modified RainbowAgent.__init__ to prevent passing 'n_step' or other Rainbow-specific parameters to DQNAgent, resolving the TypeError. - Updated tests in test_rainbow_components.py to use 'base_n_step' instead of the legacy 'n_step' parameter when instantiating RainbowAgent. - Corrected assertion in test_rainbow_agent_initialization_standard to check agent.n_step_buffer.base_n_step instead of a non-existent agent.n_step. These changes fix the agent initialization error and related test failures. A pre-existing TypeError in test_rainbow_agent_update_model_call_order_noisy (MagicMock issue) remains and is unrelated to these changes.
将直接运行脚本路径改为使用模块方式运行,解决相对导入问题
…/snake_rl into fix/replay-buffer-nan-loss
- 添加优化配置文件optimized_config.py包含调整后的超参数 - 修改agent.py支持Huber Loss和更严格的梯度裁剪 - 新增train_optimized.py用于优化训练流程 - 添加quick_test_optimization.py快速验证优化效果 - 创建optimization_plan.md记录优化策略和计划
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.
No description provided.