Skip to content

adding graph timeseries#807

Open
ndem0 wants to merge 2 commits into
0.3from
0.3-ts-graph
Open

adding graph timeseries#807
ndem0 wants to merge 2 commits into
0.3from
0.3-ts-graph

Conversation

@ndem0

@ndem0 ndem0 commented Jun 11, 2026

Copy link
Copy Markdown
Member

Description

Added the graph time series condition.

Checklist

  • Code follows the project’s Code Style Guidelines
  • Tests have been added or updated
  • Documentation has been updated if necessary
  • Pull request is linked to an open issue

@ndem0 ndem0 requested a review from a team as a code owner June 11, 2026 15:40
@ndem0 ndem0 requested a review from dario-coscia as a code owner June 11, 2026 15:50

@dario-coscia dario-coscia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment on an extra feature, but overall looks great. Be aware that tests are failing

residuals = []

# Iterate over the time steps
for step in range(1, batch["input"].shape[2]):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GiovanniCanali what do you think to add the pushforward trick here as well? Is it a condition thing or solver thing? Having it is very easy (we just need the no grad option)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely a condition-level concern, since gradient computation must be enabled or disabled when evaluating the residual between the model prediction and the target. As you noted, the implementation should be straightforward. Since the forward method is inherited from TimeSeriesCondition, we should consider implementing it directly there.

@GiovanniCanali GiovanniCanali added enhancement New feature or request pr-to-fix Label for PR that needs modification 0.3 Related to 0.3 release labels Jun 18, 2026

@GiovanniCanali GiovanniCanali left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is still a work in progress, but I have added a few comments below.

@ndem0, please remember to add the appropriate mapping to the Condition factory so that the software automatically dispatches graph time-series conditions and standard time-series conditions to the correct classes.


return _DataManager(input=graph)

def evaluate(self, batch, solver):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method appears to be identical to the one defined in TimeSeriesCondition and should therefore be inherited without modification.

return torch.stack(residuals).as_subclass(torch.Tensor)

@property
def input(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method appears to be identical to the one defined in TimeSeriesCondition and should therefore be inherited without modification.

residuals = []

# Iterate over the time steps
for step in range(1, batch["input"].shape[2]):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely a condition-level concern, since gradient computation must be enabled or disabled when evaluating the residual between the model prediction and the target. As you noted, the implementation should be straightforward. Since the forward method is inherited from TimeSeriesCondition, we should consider implementing it directly there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.3 Related to 0.3 release enhancement New feature or request pr-to-fix Label for PR that needs modification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants