40 Commits

Author SHA1 Message Date
Andrei Ivanov 924c5669e6 Fixing problem with complex numbers appearing in the lap_pe function. (#6925) 2024-02-09 10:54:26 +08:00
xiangyuzhi 09c33b9f05 [Sparse] Fix graph_transformer example (#6471) 2023-10-19 17:13:17 +08:00
Xin Yao fc36694507 [Bug] Avoid importing packaging directly (#6260)
Signed-off-by: Xin Yao <xiny@nvidia.com>
2023-09-01 12:03:12 +08:00
Quan (Andy) Gan 019a1a6072 [Optimization] Use scipy's eigs instead of numpy in lap_pe (#5855)
Co-authored-by: rudongyu <ru_dongyu@outlook.com>
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-08-24 10:34:59 +08:00
Andrei Ivanov d19887cde5 Improving transform tests. (#6123) 2023-08-10 09:59:25 +08:00
Ilia Taraban 8c213ef122 [Feature] Enable bfloat16 convert functions in Python API (#5760) 2023-07-31 18:09:32 +08:00
Chang Liu 229e288324 [Bugfix] Update dgl function random_walk_pe to be compatible with latest scipy (#5945)
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-07-06 10:30:36 +08:00
caojy1998 4fd0a158ff [CI] Fix a description bug for AddSelfLoop (#5842)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-22-182.ap-northeast-1.compute.internal>
2023-06-09 13:30:39 +08:00
Hongzhi (Steve), Chen a051271731 [Misc] Fix indent for AddSelfLoop. (#5843)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
2023-06-09 11:29:44 +08:00
rudongyu 9211d34fb8 [BugFix] Fix khop_adj (#5754) 2023-06-07 14:16:20 +08:00
czkkkkkk f41934df87 [Sparse] Add conversion between DGLGraph and SparseMatrix. (#5553) 2023-04-20 18:00:34 +08:00
rudongyu bb1f8850e5 [NN] Refactor the Code Structure of GT (#5100) 2023-04-14 11:50:14 +08:00
Hongzhi (Steve), Chen 8f9f2e2a4d [Misc] Rename number_of_edges and number_of_nodes to num_edges and num_nodes. (#5472)
* core

* revert

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
2023-03-29 08:57:47 +08:00
peizhou001 7ff041528c [Refactor] Add default ffi namespce capi (#5359) 2023-02-22 21:33:30 +08:00
Hongzhi (Steve), Chen 6e58f5f1a5 [Misc] Auto format with manual fix of 3 files and add pylint: disable= too-many-lines for functional.py. (#5330)
* blabal

* 2more

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
2023-02-20 17:14:10 +08:00
Krzysztof Sadowski f5afc6eaa2 fix rounding issue (#5159)
Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2023-02-13 18:02:55 +08:00
ZhenyuLU_Heliodore 5598503aa0 [Transform] Add SVDPE Transform Module (#5121)
* add SVD positional encoding

* modify importing module

* Fixed certain problems

* Change the test unit to a nonsigular one

* Fixed typo and make accord with lintrunner

* added svd_pe into dgl.rst

* Modified dgl.rst
2023-02-08 12:29:03 +08:00
peizhou001 56ffb650fe [API Deprecation]Deprecate contrib module (#5114) 2023-01-06 20:16:01 +08:00
Zhiteng Li c235d17d2d [Transform] Add ToLevi transform (#4884)
* add ToLevi transform

* fix parameter typo

* fix lint issues

* fix device issue

* refine according to dongyu's comments

Co-authored-by: rudongyu <ru_dongyu@outlook.com>
2022-11-16 11:54:27 +08:00
peizhou001 3132da2826 Deprecate (#4864)
rename DGLHeteroGraph to DGLGraph
2022-11-15 10:01:01 +08:00
rudongyu 1d2291943e [Transform] Add shortest distance (#4799)
* shortest dist

* update

* address issues

* update

* fix indent

* lint

* fix indent
2022-11-06 14:04:14 +08:00
Mufei Li 98adca6805 [Transform] Fix graph structure corruption with transform (#4753)
* Update

* Update

* Update

* Update

* Update test_transform.py

Co-authored-by: Ubuntu <ubuntu@ip-172-31-9-26.ap-northeast-1.compute.internal>
2022-10-27 15:34:24 +08:00
rudongyu 303b150f8c [Transform] Double Radius Node Labeling (#4513)
* add double radius node labeling

* add doc

* add test

* fix lint issue

* update

* update

* update

* update

* fix lint
2022-10-10 14:15:08 +08:00
Zhiteng Li 29434e6501 [Refactor] Refactor Laplacian positional encoding transform (#4628)
* refactor the function and module of laplacian_pe

* add blank lines between design doc

* 1st approving review

* update the unittest

* fix lint issues

* fix trailing space

* update by mufei's comments and fix backend bugs

* del test file

Co-authored-by: rudongyu <ru_dongyu@outlook.com>
Co-authored-by: Rhett Ying <85214957+Rhett-Ying@users.noreply.github.com>
2022-10-08 13:03:03 +08:00
ndickson-nvidia 684f66b7aa [Feature] Added exclude_self and output_batch to knn graph construction (Issues #4323 #4316) (#4389)
* * Added "exclude_self" and "output_batch" options to knn_graph and segmented_knn_graph
* Updated out-of-date comments on remove_edges and remove_self_loop, since they now preserve batch information

* * Changed defaults on new knn_graph and segmented_knn_graph function parameters, for compatibility; pytorch/test_geometry.py was failing

* * Added test to ensure dgl.remove_self_loop function correctly updates batch information

* * Added new knn_graph and segmented_knn_graph parameters to dgl.nn.KNNGraph and dgl.nn.SegmentedKNNGraph

* * Formatting

* * Oops, I missed the one in segmented_knn_graph when I fixed the similar thing in knn_graph

* * Fixed edge case handling when invalid k specified, since it still needs to be handled consistently for tests to pass
* Fixed context of batch info, since it must match the context of the input position data for remove_self_loop to succeed

* * Fixed batch info resulting from knn_graph when output_batch is true, for case of 3D input tensor, representing multiple segments

* * Added testing of new exclude_self and output_batch parameters on knn_graph and segmented_knn_graph, and their wrappers, KNNGraph and SegmentedKNNGraph, into the test_knn_cuda test

* * Added doc comments for new parameters

* * Added correct handling for uncommon case of k or more coincident points when excluding self edges in knn_graph and segmented_knn_graph
* Added test cases for more than k coincident points

* * Updated doc comments for output_batch parameters for clarity

* * Linter formatting fixes

* * Extracted out common function for test_knn_cpu and test_knn_cuda, to add the new test cases to test_knn_cpu

* * Rewording in doc comments

* * Removed output_batch parameter from knn_graph and segmented_knn_graph, in favour of always setting the batch information, except in knn_graph if x is a 2D tensor

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2022-09-07 08:35:26 +08:00
Rhett Ying 468c0ca4b4 [BugFix] fix crash due to incorrect dtype in dgl.to_block() (#4487)
* [BugFix] fix crash due to incorrect dtype in dgl.to_block()

* fix test failure in TF
2022-08-31 16:09:46 +08:00
Pengfei Xia 2cf05c5342 [Transform] Allow add data to self loop created by AddSelfLoop or add_self_loop (#4261)
* Update

* Update functional.py

* Update

* Update test_transform.py

* Update

* Update functional.py

* Update functional.py

* Update functional.py

* Update functional.py

* Update

* Update

* Update functional.py

* Update functional.py

* Update functional.py

* Update functional.py

* Update module.py

* Update test_transform.py

* Update test_transform.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2022-07-27 15:14:03 +08:00
Mufei Li fdbf5a0fda [DGL-Go][Doc] Update DGL-Go version to 0.0.2 and misc fix from bug bash (#4236)
* Update

* Update

* Update

* Update

Co-authored-by: Ubuntu <ubuntu@ip-172-31-53-142.us-west-2.compute.internal>
Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-07-14 21:30:38 +08:00
Rhett Ying 6a6597a02a [Feature] extend sort_csr/csc_by_tag to edge (#4164)
* [Feature] extend sort_csr/csc_by_tag to edge

* fix test ffailure in tensorflow

* refine sorting by edges

* fix docstring

* remove unnecessary mem

Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-07-01 13:16:11 +08:00
ndickson-nvidia d92a4e8b64 [Bug] Fixed missing dgl.transforms.functional __all__ entries (#4089) 2022-06-08 09:31:44 +08:00
Mufei Li 230b886ec5 [Bug fix] Misc Fix for Transforms and NN Modules (#4038)
* Update module.py

* Update utils.py

* Update utils.py

* Update utils.py

* Update module.py

* Update

* Update

* Update
2022-05-24 18:08:08 +08:00
Mufei Li de5543e3db Update functional.py (#4015) 2022-05-17 14:14:04 +08:00
ndickson-nvidia e0e8736fa0 [Feature] Added floating-point conversion functions to dgl.transforms.functional (#3890)
* * Added half_(), float_(), and double_() functions to DGLHeteroGraph, HeteroNodeDataView, and HeteroEdgeDataView, for converting floating-point tensor data to float16, float32, or float64 precision

* * Extracted out private functions for floating-point type conversion, to reduce code duplication

* * Added test for floating-point data conversion functions, half_(), float_(), and double_()

* * Moved half_(), float_(), and double_() functions from HeteroNodeDataView and HeteroEdgeDataView to Frame class

* * Updated test_float_cast() to use dgl.heterograph instead of dgl.graph

* Added to CONTRIBUTORS.md

* * Changed data type conversion to be deferred until the data is accessed, to avoid redundant conversions of data that isn't used.

* * Addressed issues flagged by linter

* * Worked around a bug in the old version of mxnet that's currently used for DGL testing

* * Only defer Column data type conversion if there is a pending device transfer or index sampling to be done.  This is expected to be the desired behaviour based on discussions of a few use cases, as described in the comments.

* * Moved floating-point feature data conversion functions to dgl.transforms.functional
* Changed them from in-place behaviour to shallow copy (out-of-place) behaviour

* * Fixed linter issues

* * Removed lines that unintentionally added to_half, to_float, and to_double to DGLHeteroGraph
* Moved _init_api line to the end of the file again

* * Removed one of the two leading underscores from Frame.__astype_float, making it not fully private

Co-authored-by: nv-dlasalle <63612878+nv-dlasalle@users.noreply.github.com>
2022-05-16 18:17:15 -07:00
Mufei Li 65b0b9e8c3 [Dataset & Transform] Synthetic Datasets for Explainability and SIGNDiffusion Transform (#3982)
* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Fix

* Update

* Update

* Update
2022-05-16 22:32:09 +08:00
Quan (Andy) Gan 34981bd676 [Doc] Fix compact_graphs example docstring (#3953)
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2022-05-08 15:58:00 +08:00
RecLusIve-F b2ec5a2ea6 [Transform] Add FeatMask and RowFeatNormalizer transforms (#3968)
* [Model]P-GNN

* updata

* [Example]P-GNN

* Update README.md

* Add NodeFeatureMasking and NormalizeFeatures

* Update

* Update transforms.rst

* Update

* Update

* Update

* Update test_transform.py

* Update

* Update

* Update test_transform.py

* Update module.py

* Update module.py

* Update module.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2022-05-07 11:59:39 +08:00
Krzysztof Sadowski 4c7bd314b4 [Feature] Radius Graph (#3829)
* radius graph

* remove trailing whitespaces from docs

* disable invalid name for transform func

* disable radius graph module invalid name

* move pylint disable before init

* fix missing nodes from point set

* update docs indexing

* add compute mode as optional param

* radius graph test

* remove trailing whitespaces

* fix precision when comparing tensors

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2022-03-30 17:23:29 +08:00
rudongyu 290b7c25c2 [Transform] Random Walk Positional Encoding & Laplacian Positional Encoding (#3869)
* [Transform] Random Walk Positional Encoding & Laplacian Positional Encoding

* Update python/dgl/transforms/module.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/transforms/functional.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/transforms/functional.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/transforms/functional.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/transforms/functional.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/transforms/functional.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/transforms/functional.py & python/dgl/transforms/module.py

* update python/dgl/transforms/functional.py

* update doc indexing

* update unit test

* support weighted graphs for random_walk_pe

* change reference

* fix linter errors

* fix datatype compatibility with MXNet & TF

* fix device errors

* fix result precision errors

* change tensorflow abs api

* reboost CI

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2022-03-30 15:59:28 +08:00
Mufei Li 3bd5a9b6d1 [Doc] Fix Doc (#3777)
* Update

* Update

* Update

* Update
2022-02-25 17:21:06 +08:00
Mufei Li 6d9433b04f [Transform] [Doc] Rename transform to transforms and update doc (#3765)
* Update

* Update

* Update

* Fix

* Update

* Update

* Update

* Fix
2022-02-24 21:28:15 +08:00