Repository navigation
Add static graph embedding caching across autoregressive rollouts #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
6f7f3ee
b94914b
8953c1d
d337046
2a0b099
d903343
ac0b1fc
527ddb4
7c854fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,13 +116,23 @@ def forward( | |
| pred_std_list = [] | ||
| pred_steps = forcing_features.shape[1] | ||
|
|
||
| static_embeddings = self.predictor.embed_static_features() | ||
|
|
||
| for i in range(pred_steps): | ||
| forcing = forcing_features[:, i] | ||
| boundary_state = boundary_states[:, i] | ||
|
|
||
| pred_state, pred_std = self.predictor( | ||
| prev_state, prev_prev_state, forcing | ||
| ) | ||
| if static_embeddings is not None: | ||
| pred_state, pred_std = self.predictor( | ||
| prev_state, | ||
| prev_prev_state, | ||
| forcing, | ||
| static_embeddings=static_embeddings, | ||
| ) | ||
| else: | ||
| pred_state, pred_std = self.predictor( | ||
| prev_state, prev_prev_state, forcing | ||
| ) | ||
|
Comment on lines
+116
to
+132
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks unnecessary, why can't static_embedding just be fed directly when it is None? If this does not work for some reason with the checkpoint, pls add a comment to clarify.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Predictors that return None from embed_static_features() (such as PersistencePredictor, BaseGraphEFM, and TrainableStepPredictor) do not accept static_embeddings in forward(), so passing static_embeddings=None raises TypeError |
||
|
|
||
| # Overwrite boundary with true state using ARForecaster's mask | ||
| new_state = ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.