Skip to content
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

[Bug]: Graph Construction Bug When Periodic Properties Transform Not Used #227

Closed
melo-gonzo opened this issue May 28, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@melo-gonzo
Copy link
Collaborator

Expected behavior

I would expect a DGL or PyG graph to consist of more than just self-loops when constructed without using the PeriodicPropertiesTransform.

Actual behavior

(First mentioned here in #132.)

In each dataset, src_nodes and dst_nodes are calculated which are meant to be used for point cloud featurization, however in the majority of cases, point clouds are not used for training and instead graphs are constructed. Due to always having the point cloud computation step set the src_nodes and dst_nodes attributes in the dataset, this step of DGL conversion (similarly, this step of PyG conversion) will never run, which constructs a graph based on the cutoff radius and distance matrix. The result of skipping this step if a graph that only contains self loops.

More undesired behavior manifests itself, as seen in failing tests, where not using full_pairwise option for the point cloud featurization will cause problems with the graph construction due to not having an appropriated src to dst node mapping (len(src_nodes) > len(dst_nodes)).

Steps to reproduce the problem

Example 1 (Inspect the graph edges):

from matsciml.datasets.lips import LiPSDataset
from matsciml.datasets.transforms import (
    PointCloudToGraphTransform,
)

dset = LiPSDataset.from_devset(
    transforms=[
        PointCloudToGraphTransform("dgl", cutoff_dist=15.0),
    ],
)
graph = dset.__getitem__(0)['graph']
print(len(graph.edges()[0]), len(graph.edges()[1]))

Example 2:

from matsciml.datasets.lips import LiPSDataset
from matsciml.datasets.transforms import (
    PointCloudToGraphTransform,
)

dset = LiPSDataset.from_devset(
    full_pairwise=False,
    transforms=[
        PointCloudToGraphTransform("dgl", cutoff_dist=15.0),
    ],
)
sample = dset.__getitem__(0)

Specifications

Latest and greatest.

@melo-gonzo
Copy link
Collaborator Author

closed in #228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant