Time Discretization - #87
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
These changes are patching issues that arised from incorrect auto-merge on previous PRs. This need not be reviewed.
No matter how you coarsen, the number of nodes will never reduce. Theoretically this would be the case. Because when you coarsen, all you do is remove redundant edges which would originally have finer / different timestamps, now they are remapped to have the same timestamps. Therefore, if the node is in the graph then it will remain there. |
I thought the TGM assumption is that the user can't modify the graph once it is created (except for coarsening). I don't think we need to handle this issue. Once coarsened, the coarsen graph has no association with the original graph directly. |
actually this wouldn't exist if we only allow coarsen at construction haha |
Purpose
The purpose of this PR is to implement temporal coarsening. We expose a new method on the
DGraphlevel which creates a deep-copy of the underlying storage using a coarsened time granularity.Things to think about
num_nodesand it's implicit semantics? If the result of my coarsening is such that certain nodes no longer exist, I currently keep them as part of the graph (this has implication for static node features shape, for instance). This does not technically violate any invariants but is different to our general workflow (where number of nodes matches max node id across all events on the graph)discretize()method in the backend needs to also take aDGSliceas an argument. And, this means we have to handle the edge case of empty graphs as well (since the sliced graph can end up empty).Key Changes
DGStoragebackend API has a new function for discretizing the storageDGraphAPI has a new method that forwards to the storage to create a new coarsened graphtgm/test/unit/test_data.py
Line 812 in de226fb
TODO
Relevant Prs
Close #86
Out of scope