ojaffe commited on
Commit
1c7c008
·
verified ·
1 Parent(s): 5f980e3

Upload folder using huggingface_hub

Browse files
__pycache__/predict.cpython-311.pyc CHANGED
Binary files a/__pycache__/predict.cpython-311.pyc and b/__pycache__/predict.cpython-311.pyc differ
 
predict.py CHANGED
@@ -164,9 +164,11 @@ def predict_next_frame(ens, context_frames: np.ndarray) -> np.ndarray:
164
 
165
  ar_pred = torch.stack(ar_preds, dim=1)
166
 
 
 
167
  predicted = torch.zeros_like(direct_pred)
168
  for step in range(PRED_FRAMES):
169
- ar_weight = 0.85 - (step / (PRED_FRAMES - 1)) * 0.3
170
  direct_weight = 1.0 - ar_weight
171
  predicted[:, step] = ar_weight * ar_pred[:, step] + direct_weight * direct_pred[:, step]
172
 
@@ -230,15 +232,11 @@ def predict_next_frame(ens, context_frames: np.ndarray) -> np.ndarray:
230
 
231
  ar_pred = sum(all_ar_runs) / len(all_ar_runs)
232
 
233
- # Blend in residual space
234
- last_ctx = last_tensor.unsqueeze(1).expand_as(direct_pred)
235
  predicted = torch.zeros_like(direct_pred)
236
  for step in range(PRED_FRAMES):
237
- w = 0.65 - (step / (PRED_FRAMES - 1)) * 0.3
238
- ar_residual = ar_pred[:, step] - last_ctx[:, step]
239
- direct_residual = direct_pred[:, step] - last_ctx[:, step]
240
- blended_residual = w * ar_residual + (1.0 - w) * direct_residual
241
- predicted[:, step] = torch.clamp(last_ctx[:, step] + blended_residual, 0, 1)
242
 
243
  predicted_np = predicted[0].cpu().numpy()
244
  ens.direct_cache = []
 
164
 
165
  ar_pred = torch.stack(ar_preds, dim=1)
166
 
167
+ # Custom per-step AR weights (nonlinear schedule)
168
+ pong_ar_weights = [0.90, 0.90, 0.90, 0.90, 0.70, 0.70, 0.45, 0.45]
169
  predicted = torch.zeros_like(direct_pred)
170
  for step in range(PRED_FRAMES):
171
+ ar_weight = pong_ar_weights[step]
172
  direct_weight = 1.0 - ar_weight
173
  predicted[:, step] = ar_weight * ar_pred[:, step] + direct_weight * direct_pred[:, step]
174
 
 
232
 
233
  ar_pred = sum(all_ar_runs) / len(all_ar_runs)
234
 
 
 
235
  predicted = torch.zeros_like(direct_pred)
236
  for step in range(PRED_FRAMES):
237
+ ar_weight = 0.65 - (step / (PRED_FRAMES - 1)) * 0.3
238
+ direct_weight = 1.0 - ar_weight
239
+ predicted[:, step] = ar_weight * ar_pred[:, step] + direct_weight * direct_pred[:, step]
 
 
240
 
241
  predicted_np = predicted[0].cpu().numpy()
242
  ens.direct_cache = []