fix: correct EpisodeReplayBuffer default max_ep_len from 24 to 48#6
Open
idealiu555 wants to merge 1 commit into
Open
fix: correct EpisodeReplayBuffer default max_ep_len from 24 to 48#6idealiu555 wants to merge 1 commit into
idealiu555 wants to merge 1 commit into
Conversation
Added max_ep_len parameter to EpisodeReplayBuffer.
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.
Problem
strategy_train_env/bidding_train_env/baseline/dt/utils.py文件中EpisodeReplayBuffer.__init__的max_ep_len默认值设为 24,与数据生成器以及提供数据集的 episode 长度不符。训练数据生成器(
train_data_generator.py:93)硬编码timeStepIndexNum = 48,每条轨迹共 48 个时间步。由于
utils.py中存在截断逻辑:timesteps[timesteps >= self.max_ep_len] = self.max_ep_len - 1默认值 24 会将第 24–47 步的时间步全部截断为 23,导致后半段 episode 的 timestep embedding 全部相同,模型丧失对后半程时间进度的感知能力。
Fix
将
strategy_train_env/run/run_decision_transformer.py文件中创建EpisodeReplayBuffer对象的max_ep_len从默认值 24 修正为 48,与数据生成逻辑以及提供的数据集对齐。