Skip to content
Discussion options

You must be logged in to vote

Thanks to @wsad1, I was able to roughly replicate the original message passing using PyG (particularly subgraph) and NetworkX. To anyone else interested in this kind of message passing, here is a very simple example that calculates the critical path length (weighted by node values) of a dag starting from each node:

import torch
from torch_geometric.nn import MessagePassing
from torch_geometric.utils import subgraph
import networkx as nx
from networkx.drawing.nx_agraph import graphviz_layout


class CriticalPathConv(MessagePassing):
    def __init__(self):
        super().__init__(aggr="max", flow='target_to_source')

    def forward(self, x, edge_index):
        return self.propagate(edge…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ArchieGertsman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants