Fix DeMemWM training anchor prefix window
Browse files
datasets/video/minecraft_video_dememwm_latent_dataset.py
CHANGED
|
@@ -198,7 +198,8 @@ class MinecraftVideoDeMemWMLatentDataset(torch.utils.data.Dataset):
|
|
| 198 |
|
| 199 |
# === 2. Select target and memory indices ===
|
| 200 |
target_positions = frame_idx + self._target_offsets
|
| 201 |
-
anchor_start = self.initial_frame_offset
|
|
|
|
| 202 |
memory_indices, memory_masks = select_memory_indices(
|
| 203 |
poses_pool,
|
| 204 |
target_positions,
|
|
@@ -208,7 +209,7 @@ class MinecraftVideoDeMemWMLatentDataset(torch.utils.data.Dataset):
|
|
| 208 |
latents=latents,
|
| 209 |
actions=actions,
|
| 210 |
anchor_candidate_start=anchor_start,
|
| 211 |
-
anchor_candidate_stop=
|
| 212 |
)
|
| 213 |
ordered_memory = [memory_indices[key] for key in SEGMENT_KEYS]
|
| 214 |
source_positions = np.concatenate([target_positions, *ordered_memory]).astype(np.int64)
|
|
|
|
| 198 |
|
| 199 |
# === 2. Select target and memory indices ===
|
| 200 |
target_positions = frame_idx + self._target_offsets
|
| 201 |
+
anchor_start = max(self.initial_frame_offset, frame_idx - self.context_length)
|
| 202 |
+
anchor_stop = frame_idx
|
| 203 |
memory_indices, memory_masks = select_memory_indices(
|
| 204 |
poses_pool,
|
| 205 |
target_positions,
|
|
|
|
| 209 |
latents=latents,
|
| 210 |
actions=actions,
|
| 211 |
anchor_candidate_start=anchor_start,
|
| 212 |
+
anchor_candidate_stop=anchor_stop,
|
| 213 |
)
|
| 214 |
ordered_memory = [memory_indices[key] for key in SEGMENT_KEYS]
|
| 215 |
source_positions = np.concatenate([target_positions, *ordered_memory]).astype(np.int64)
|