tgraphx 0.2.9__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. tgraphx-0.3.1/PKG-INFO +455 -0
  2. tgraphx-0.3.1/README.md +403 -0
  3. {tgraphx-0.2.9 → tgraphx-0.3.1}/pyproject.toml +5 -3
  4. tgraphx-0.3.1/tests/test_dashboard_metadata.py +182 -0
  5. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_documentation_claims.py +26 -0
  6. tgraphx-0.3.1/tests/test_experiments.py +296 -0
  7. tgraphx-0.3.1/tests/test_explainability.py +183 -0
  8. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_imports.py +1 -0
  9. tgraphx-0.3.1/tests/test_math_invariants_v030.py +169 -0
  10. tgraphx-0.3.1/tests/test_model_zoo.py +161 -0
  11. tgraphx-0.3.1/tests/test_release_validation_v030.py +196 -0
  12. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_synthetic_datasets.py +1 -1
  13. tgraphx-0.3.1/tests/test_tiny_overfit_v030.py +191 -0
  14. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/__init__.py +44 -3
  15. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/folder.py +4 -3
  16. tgraphx-0.3.1/tgraphx/experiments/__init__.py +77 -0
  17. tgraphx-0.3.1/tgraphx/experiments/callbacks.py +202 -0
  18. tgraphx-0.3.1/tgraphx/experiments/checkpoints.py +56 -0
  19. tgraphx-0.3.1/tgraphx/experiments/cli.py +93 -0
  20. tgraphx-0.3.1/tgraphx/experiments/config.py +267 -0
  21. tgraphx-0.3.1/tgraphx/experiments/grid.py +123 -0
  22. tgraphx-0.3.1/tgraphx/experiments/runner.py +342 -0
  23. tgraphx-0.3.1/tgraphx/experiments/summarize.py +89 -0
  24. tgraphx-0.3.1/tgraphx/explain/__init__.py +50 -0
  25. tgraphx-0.3.1/tgraphx/explain/attention.py +53 -0
  26. tgraphx-0.3.1/tgraphx/explain/edge_attribution.py +121 -0
  27. tgraphx-0.3.1/tgraphx/explain/export.py +106 -0
  28. tgraphx-0.3.1/tgraphx/explain/integrated_gradients.py +62 -0
  29. tgraphx-0.3.1/tgraphx/explain/patch_heatmap.py +86 -0
  30. tgraphx-0.3.1/tgraphx/explain/saliency.py +74 -0
  31. tgraphx-0.3.1/tgraphx/explain/utils.py +62 -0
  32. tgraphx-0.3.1/tgraphx/layers/appnp.py +78 -0
  33. tgraphx-0.3.1/tgraphx/layers/gatv2.py +130 -0
  34. tgraphx-0.3.1/tgraphx/layers/pooling.py +60 -0
  35. tgraphx-0.3.1/tgraphx/layers/vector_gcn.py +94 -0
  36. tgraphx-0.3.1/tgraphx/models/model_zoo.py +53 -0
  37. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/tracking.py +172 -1
  38. tgraphx-0.3.1/tgraphx.egg-info/PKG-INFO +455 -0
  39. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx.egg-info/SOURCES.txt +28 -0
  40. tgraphx-0.3.1/tgraphx.egg-info/entry_points.txt +5 -0
  41. tgraphx-0.2.9/PKG-INFO +0 -1611
  42. tgraphx-0.2.9/README.md +0 -1558
  43. tgraphx-0.2.9/tgraphx.egg-info/PKG-INFO +0 -1611
  44. tgraphx-0.2.9/tgraphx.egg-info/entry_points.txt +0 -2
  45. {tgraphx-0.2.9 → tgraphx-0.3.1}/LICENSE +0 -0
  46. {tgraphx-0.2.9 → tgraphx-0.3.1}/setup.cfg +0 -0
  47. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_3d_support.py +0 -0
  48. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_amp_compile.py +0 -0
  49. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_backward_compatibility.py +0 -0
  50. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_benchmark_smoke.py +0 -0
  51. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_chunking.py +0 -0
  52. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_dashboard.py +0 -0
  53. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_dataset_cache.py +0 -0
  54. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_dataset_docs_claims.py +0 -0
  55. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_dataset_download_mocked.py +0 -0
  56. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_dataset_registry.py +0 -0
  57. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_datasets_base.py +0 -0
  58. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_devices.py +0 -0
  59. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_distributed_compat.py +0 -0
  60. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_edge_features.py +0 -0
  61. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_edge_weight.py +0 -0
  62. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_factories.py +0 -0
  63. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_folder_datasets.py +0 -0
  64. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_gat_chunking.py +0 -0
  65. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_gnn_families.py +0 -0
  66. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_gradients.py +0 -0
  67. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_graph.py +0 -0
  68. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_graph_api.py +0 -0
  69. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_graph_builders.py +0 -0
  70. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_graph_transformer_v027.py +0 -0
  71. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_hetero_batch.py +0 -0
  72. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_hetero_layers.py +0 -0
  73. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_hetero_sampling.py +0 -0
  74. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_layers.py +0 -0
  75. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_math.py +0 -0
  76. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_metrics.py +0 -0
  77. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_models.py +0 -0
  78. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_packaging.py +0 -0
  79. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_performance_smoke.py +0 -0
  80. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_pyg_dgl_ogb_wrappers.py +0 -0
  81. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_random_walk_sample.py +0 -0
  82. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_sampling.py +0 -0
  83. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_sampling_loaders.py +0 -0
  84. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_temporal_sampling.py +0 -0
  85. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_temporal_v025.py +0 -0
  86. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_torchvision_wrappers.py +0 -0
  87. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_tracking.py +0 -0
  88. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_training.py +0 -0
  89. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_transforms.py +0 -0
  90. {tgraphx-0.2.9 → tgraphx-0.3.1}/tests/test_v024_features.py +0 -0
  91. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/__init__.py +0 -0
  92. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/dataloader.py +0 -0
  93. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/graph.py +0 -0
  94. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/graph_utils.py +0 -0
  95. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/hetero_batch.py +0 -0
  96. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/hetero_graph.py +0 -0
  97. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/temporal.py +0 -0
  98. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/temporal_batch.py +0 -0
  99. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/core/utils.py +0 -0
  100. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/dashboard/__init__.py +0 -0
  101. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/dashboard/__main__.py +0 -0
  102. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/dashboard/app.py +0 -0
  103. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/dashboard/static/dashboard.css +0 -0
  104. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/dashboard/static/dashboard.js +0 -0
  105. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/__init__.py +0 -0
  106. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/base.py +0 -0
  107. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/cache.py +0 -0
  108. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/converters.py +0 -0
  109. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/dgl_wrappers.py +0 -0
  110. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/download.py +0 -0
  111. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/errors.py +0 -0
  112. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/metadata.py +0 -0
  113. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/ogb_wrappers.py +0 -0
  114. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/pyg_wrappers.py +0 -0
  115. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/registry.py +0 -0
  116. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/synthetic.py +0 -0
  117. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/datasets/torchvision_wrappers.py +0 -0
  118. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/distributed.py +0 -0
  119. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/graph_builders.py +0 -0
  120. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/hetero_sampling.py +0 -0
  121. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/interop.py +0 -0
  122. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/__init__.py +0 -0
  123. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/_dim.py +0 -0
  124. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/_scatter.py +0 -0
  125. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/aggregator.py +0 -0
  126. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/attention_message.py +0 -0
  127. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/base.py +0 -0
  128. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/conv_message.py +0 -0
  129. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/factory.py +0 -0
  130. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/gat.py +0 -0
  131. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/gin.py +0 -0
  132. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/graph_transformer.py +0 -0
  133. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/hetero.py +0 -0
  134. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/hetero_readout.py +0 -0
  135. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/safe_pool.py +0 -0
  136. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/sage.py +0 -0
  137. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/temporal_readout.py +0 -0
  138. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/layers/transformer_encodings.py +0 -0
  139. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/learned_graph.py +0 -0
  140. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/__init__.py +0 -0
  141. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/classification.py +0 -0
  142. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/link_prediction.py +0 -0
  143. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/ogb.py +0 -0
  144. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/ranking.py +0 -0
  145. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/regression.py +0 -0
  146. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/metrics/reports.py +0 -0
  147. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/__init__.py +0 -0
  148. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/cnn_encoder.py +0 -0
  149. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/cnn_gnn_model.py +0 -0
  150. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/edge_predictor.py +0 -0
  151. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/factory.py +0 -0
  152. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/graph_classifier.py +0 -0
  153. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/hetero_models.py +0 -0
  154. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/node_classifier.py +0 -0
  155. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/pre_encoder.py +0 -0
  156. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/regressors.py +0 -0
  157. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/models/temporal_models.py +0 -0
  158. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/performance.py +0 -0
  159. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/sampling.py +0 -0
  160. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/sampling_loaders.py +0 -0
  161. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/temporal_sampling.py +0 -0
  162. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/training.py +0 -0
  163. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/__init__.py +0 -0
  164. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/compose.py +0 -0
  165. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/features.py +0 -0
  166. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/graph.py +0 -0
  167. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/patch.py +0 -0
  168. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/positional.py +0 -0
  169. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx/transforms/splits.py +0 -0
  170. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx.egg-info/dependency_links.txt +0 -0
  171. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx.egg-info/requires.txt +0 -0
  172. {tgraphx-0.2.9 → tgraphx-0.3.1}/tgraphx.egg-info/top_level.txt +0 -0
tgraphx-0.3.1/PKG-INFO ADDED
@@ -0,0 +1,455 @@
1
+ Metadata-Version: 2.4
2
+ Name: tgraphx
3
+ Version: 0.3.1
4
+ Summary: Tensor-aware graph neural networks preserving spatial node feature layouts
5
+ Author-email: Arash Sajjadi <arash.sajjadi@usask.ca>
6
+ Maintainer-email: Arash Sajjadi <arash.sajjadi@usask.ca>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/arashsajjadi/TGraphX
9
+ Project-URL: Repository, https://github.com/arashsajjadi/TGraphX
10
+ Project-URL: Documentation, https://github.com/arashsajjadi/TGraphX/tree/main/docs
11
+ Project-URL: Issues, https://github.com/arashsajjadi/TGraphX/issues
12
+ Project-URL: Changelog, https://github.com/arashsajjadi/TGraphX/blob/main/CHANGELOG.md
13
+ Project-URL: Paper, https://arxiv.org/abs/2504.03953
14
+ Keywords: graph neural networks,GNN,CNN,spatial,PyTorch,computer vision,message passing,tensor-aware,dashboard,graph learning
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Scientific/Engineering :: Image Recognition
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Requires-Python: >=3.10
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: torch>=1.13
32
+ Requires-Dist: torchvision>=0.14
33
+ Requires-Dist: pyyaml>=5.4
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest>=7.0; extra == "dev"
36
+ Requires-Dist: build>=0.10; extra == "dev"
37
+ Requires-Dist: twine>=4.0; extra == "dev"
38
+ Provides-Extra: monitoring
39
+ Requires-Dist: psutil>=5.9; extra == "monitoring"
40
+ Requires-Dist: pynvml>=11.0; extra == "monitoring"
41
+ Provides-Extra: tracking
42
+ Requires-Dist: tensorboard>=2.11; extra == "tracking"
43
+ Provides-Extra: mlflow
44
+ Requires-Dist: mlflow>=2.0; extra == "mlflow"
45
+ Provides-Extra: pyg
46
+ Requires-Dist: torch-geometric>=2.0; extra == "pyg"
47
+ Provides-Extra: ogb
48
+ Requires-Dist: ogb>=1.3.6; extra == "ogb"
49
+ Provides-Extra: pillow
50
+ Requires-Dist: Pillow>=9.0; extra == "pillow"
51
+ Dynamic: license-file
52
+
53
+ <p align="center">
54
+ <img src="https://raw.githubusercontent.com/arashsajjadi/TGraphX/main/TGRAPHX.png" alt="TGraphX logo" width="220">
55
+ </p>
56
+
57
+ # TGraphX
58
+
59
+ [![Tests](https://github.com/arashsajjadi/TGraphX/actions/workflows/tests.yml/badge.svg)](https://github.com/arashsajjadi/TGraphX/actions/workflows/tests.yml)
60
+ [![PyPI version](https://img.shields.io/pypi/v/tgraphx.svg)](https://pypi.org/project/tgraphx/)
61
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
62
+ [![PyTorch 1.13+](https://img.shields.io/badge/pytorch-1.13%2B-orange.svg)](https://pytorch.org/)
63
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
64
+
65
+ **Preprint:** [TGraphX: Tensor-Aware Graph Neural Network for Multi-Dimensional Feature Learning](https://arxiv.org/abs/2504.03953) · *Sajjadi & Eramian, arXiv 2025*
66
+
67
+ Developed by **Arash Sajjadi**, PhD Candidate in Computer Science, University of Saskatchewan. Academic supervision: **Mark Eramian**.
68
+
69
+ TGraphX is a PyTorch library for graph neural networks whose **node features are multi-dimensional tensors** — `[C, H, W]` image-patch feature maps, `[C, D, H, W]` volumetric maps, or plain vectors `[D]`. Convolutional message passing operates directly on spatial node features, so local structure is never destroyed by flattening.
70
+
71
+ ---
72
+
73
+ ## Install
74
+
75
+ ```bash
76
+ pip install tgraphx
77
+ ```
78
+
79
+ Optional extras (all lazy-imported, none required for the base package):
80
+
81
+ ```bash
82
+ pip install "tgraphx[tracking]" # TensorBoard
83
+ pip install "tgraphx[mlflow]" # MLflow
84
+ pip install "tgraphx[monitoring]" # psutil + pynvml (dashboard hardware panel)
85
+ pip install "tgraphx[pyg]" # PyTorch Geometric dataset adapter
86
+ pip install "tgraphx[ogb]" # OGB dataset adapter
87
+ pip install "tgraphx[pillow]" # ImageFolder dataset
88
+ pip install "tgraphx[dev]" # pytest + build + twine
89
+ ```
90
+
91
+ DGL has platform-sensitive wheels and is not packaged as a TGraphX extra. Follow the [DGL install guide](https://www.dgl.ai/pages/start.html); the DGL adapter is available either way once DGL is on the import path.
92
+
93
+ For a custom PyTorch build (CPU-only or specific CUDA), install PyTorch first, then TGraphX:
94
+
95
+ ```bash
96
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
97
+ pip install tgraphx
98
+ ```
99
+
100
+ ---
101
+
102
+ ## 60-second quickstart
103
+
104
+ **Vector node features:**
105
+
106
+ ```python
107
+ import torch
108
+ from tgraphx import Graph, LinearMessagePassing
109
+
110
+ x = torch.randn(8, 32)
111
+ edge_index = torch.stack([torch.arange(8), (torch.arange(8) + 1) % 8])
112
+ g = Graph(x, edge_index)
113
+
114
+ layer = LinearMessagePassing(in_shape=(32,), out_shape=(64,))
115
+ out = layer(g.node_features, g.edge_index) # [8, 64]
116
+ out.sum().backward()
117
+ ```
118
+
119
+ **Spatial `[C, H, W]` node features — preserved through message passing:**
120
+
121
+ ```python
122
+ import torch
123
+ from tgraphx import Graph, ConvMessagePassing
124
+
125
+ N, C, H, W = 6, 16, 8, 8
126
+ g = Graph(torch.randn(N, C, H, W), torch.stack(
127
+ [torch.arange(N), (torch.arange(N) + 1) % N]))
128
+
129
+ layer = ConvMessagePassing(in_shape=(C, H, W), out_shape=(32, H, W))
130
+ out = layer(g.node_features, g.edge_index) # [6, 32, 8, 8]
131
+ out.sum().backward()
132
+ ```
133
+
134
+ A Colab tutorial walks through every workflow:
135
+ [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1agls1xtqE5WxbWthcG0HEa3Gbk3fvoCD?usp=sharing)
136
+
137
+ ---
138
+
139
+ ## Why tensor-aware GNNs
140
+
141
+ Standard GNN frameworks expect flat vector node features. Flattening a `[C, H, W]` feature map into a `[C·H·W]` vector discards the spatial structure that makes CNNs effective. TGraphX keeps each node's representation as a tensor and applies 1×1 convolutions during message passing, so every neighbourhood aggregation step acts like a miniature CNN across neighbouring feature maps.
142
+
143
+ ```
144
+ M_{i→j} = φ( X_i, X_j, E_{i→j} )
145
+ A_j = AGG_{i ∈ N(j)} M_{i→j}
146
+ X'_j = ψ( X_j, A_j )
147
+ ```
148
+
149
+ Spatial dimensions `H` and `W` are preserved through every learned transform. Aggregations are permutation-invariant; the layers are permutation-equivariant under node relabelling (verified by `tests/test_math_invariants_v030.py`).
150
+
151
+ ---
152
+
153
+ ## Stable core APIs
154
+
155
+ | Component | Class | Input node shape | Notes |
156
+ |-----------|-------|-----------------|-------|
157
+ | Graph data structure | `Graph`, `GraphBatch` | any | Validated; supports `.to(device)` |
158
+ | Tensor-aware GCN-style message passing | `ConvMessagePassing` | `[N, C, H, W]` | `aggr="sum" / "mean" / "max"`; chunked forward |
159
+ | Tensor-aware multi-head GAT | `TensorGATLayer` | `[N, C, H, W]` | Softmax over incoming edges per destination per head; two-pass log-sum-exp chunked forward |
160
+ | Tensor-aware GraphSAGE | `TensorGraphSAGELayer` | `[N, C, H, W]` | Mean / max aggregation; chunked forward |
161
+ | Tensor-aware GIN / GINEConv | `TensorGINLayer` | `[N, C, H, W]` | `(1+ε)·h_j + Σ h_i`; chunked forward |
162
+ | Vector message passing | `LinearMessagePassing` | `[N, D]` | Base layer with linear projections |
163
+ | Custom-layer base class | `TensorMessagePassingLayer` | any | Override `message` / `update` |
164
+ | Vector model-zoo | `GCNConv`, `GATv2Conv`, `APPNP` | `[N, D]` | New in v0.3.0; permutation-equivariance and tiny-overfit tested |
165
+ | Pooling helpers | `global_mean_pool`, `global_sum_pool`, `global_max_pool` | `[N, *]` | Per-graph reductions |
166
+ | CNN patch encoder | `CNNEncoder` | `[N, C_in, pH, pW]` | Outputs spatial feature maps |
167
+ | Graph classification | `GraphClassifier` | `[N, C, H, W]` | Mean / sum / max readout |
168
+ | Node classification | `NodeClassifier` | `[N, D]` | Vector features |
169
+
170
+ 3-D volumetric node features `[N, C, D, H, W]` are supported by `ConvMessagePassing`, `TensorGATLayer`, `TensorGraphSAGELayer`, and `TensorGINLayer` (pass `spatial_rank=3`).
171
+
172
+ ### Factories
173
+
174
+ ```python
175
+ from tgraphx import make_layer, build_model
176
+
177
+ layer = make_layer("gat", in_shape=(8, 4, 4), out_shape=(16, 4, 4), heads=2, residual=True)
178
+ model = build_model(
179
+ task="graph_classification", layer="conv",
180
+ in_shape=(3, 4, 4), hidden_shape=(8, 4, 4),
181
+ num_layers=2, num_classes=10, pooling="mean",
182
+ )
183
+ ```
184
+
185
+ | Task | `[N,D]` | `[N,C,H,W]` | `[N,C,D,H,W]` |
186
+ |------|:-:|:-:|:-:|
187
+ | `node_classification` | yes | yes | yes |
188
+ | `node_regression` | yes | yes | yes |
189
+ | `graph_classification` | yes | yes | yes |
190
+ | `graph_regression` | yes | yes | yes |
191
+ | `edge_prediction` | yes | yes (spatial pool) | yes (spatial pool) |
192
+
193
+ ---
194
+
195
+ ## Datasets, transforms, metrics, benchmarks
196
+
197
+ TGraphX ships a unified dataset registry, native synthetic datasets, folder-backed datasets, and optional adapters for torchvision, PyG, DGL, and OGB. **TGraphX does not redistribute third-party datasets**; adapters delegate download and parsing to the upstream library, and any download requires the user to pass `download=True` explicitly.
198
+
199
+ ```python
200
+ from tgraphx.datasets import list_datasets, dataset_info, get_dataset
201
+
202
+ print(list_datasets()) # 34 registered datasets
203
+ ds = get_dataset("synthetic:patch_graph", num_graphs=32, seed=0)
204
+ g = ds[0]
205
+ ```
206
+
207
+ Cache layout: `<root>` (or `$TGRAPHX_DATA`, or `~/.cache/tgraphx/datasets`). Inspect with `tgraphx.datasets.cache_summary()`; clear with `clear_cache(...)`.
208
+
209
+ | Layer | Highlights |
210
+ |-------|-----------|
211
+ | `tgraphx.datasets` | Native synthetic + folder + torchvision/PyG/DGL/OGB adapters; safe atomic downloads with SHA-256 checksums and path-traversal-blocked archive extraction |
212
+ | `tgraphx.transforms` | `Compose`, `AddSelfLoops`, `RemoveSelfLoops`, `ToUndirected`, `NormalizeFeatures`, `StandardizeFeatures`, `AddDegreeFeatures`, `RandomNodeSplit`, `RandomLinkSplit`, `AddDegreeEncoding`, `AddLaplacianEigenvectors`, `PatchifyImage`, `BuildGridGraph`, … |
213
+ | `tgraphx.metrics` | Pure-PyTorch `accuracy`, `top_k_accuracy`, `precision_recall_f1`, `classification_report`, `mae`, `mse`, `rmse`, `r2_score`, `hits_at_k`, `mean_reciprocal_rank`, `ndcg_at_k`, `roc_auc`, `average_precision` |
214
+ | `benchmarks/` | `benchmark_dataset_loading.py`, `benchmark_training_synthetic.py`, `benchmark_tensor_vs_flatten.py`, `benchmark_transforms.py`, `benchmark_metrics.py`, `benchmark_layers.py`, `benchmark_graph_builders.py`, `benchmark_sampling.py`. Every benchmark accepts `--small` and `--output JSON`. |
215
+
216
+ Detailed write-ups: [docs/datasets.md](docs/datasets.md), [docs/transforms.md](docs/transforms.md), [docs/metrics.md](docs/metrics.md), [docs/benchmarks.md](docs/benchmarks.md), [docs/dataset_license_policy.md](docs/dataset_license_policy.md).
217
+
218
+ Importing `tgraphx`, `tgraphx.datasets`, `tgraphx.transforms`, `tgraphx.metrics`, `tgraphx.experiments`, or `tgraphx.explain` does **not** import torch_geometric / dgl / ogb.
219
+
220
+ ---
221
+
222
+ ## Experiment manager
223
+
224
+ `tgraphx.experiments` (new in v0.3.0) is a lightweight, dashboard-compatible experiment manager. YAML / JSON configs are validated against an explicit schema (no `eval`, no `exec`). Every run writes its artefacts under `run_dir` only:
225
+
226
+ ```
227
+ runs/<run_name>/<timestamp>/
228
+ ├── run_metadata.json # run name, status, device, seed, version
229
+ ├── experiment_config.json # exact config copy
230
+ ├── experiment_summary.json # epochs, best metric, final loss
231
+ ├── metrics.csv # dashboard-compatible
232
+ └── checkpoints/{best,latest}.pt
233
+ ```
234
+
235
+ ```python
236
+ from tgraphx.experiments import Runner, load_config
237
+
238
+ cfg = load_config("examples/configs/synthetic_patch_graph.yaml")
239
+ runner = Runner(cfg)
240
+ history = runner.fit()
241
+ ```
242
+
243
+ Or via the CLI (registered as console scripts):
244
+
245
+ ```bash
246
+ tgraphx-train examples/configs/synthetic_patch_graph.yaml
247
+ tgraphx-grid examples/configs/grid_sweep.yaml
248
+ tgraphx-report runs/ # → Markdown summary
249
+ ```
250
+
251
+ Built-in callbacks: `EarlyStopping`, `ModelCheckpoint`, `CSVLoggerCallback`, `LearningRateLogger`. Multi-seed and grid sweeps via `GridRunner`. The dashboard reads the same files when you run `tgraphx-dashboard --logdir runs/<run_name>`.
252
+
253
+ See [docs/experiments.md](docs/experiments.md) for the full schema.
254
+
255
+ ---
256
+
257
+ ## Explainability
258
+
259
+ `tgraphx.explain` (new in v0.3.0) provides diagnostic explainability tools. They run on CPU by default, do not retain autograd graphs, and never make causal claims about a model's predictions.
260
+
261
+ ```python
262
+ from tgraphx.explain import (
263
+ node_feature_saliency, integrated_gradients,
264
+ edge_perturbation_attribution, attention_to_edge_scores,
265
+ patch_saliency_to_image_grid,
266
+ export_explanation_metadata, export_edge_scores_csv,
267
+ )
268
+
269
+ sal = node_feature_saliency(model, graph, target=label)
270
+ ig = integrated_gradients(model, graph, target=label, steps=16)
271
+ edge_imp = edge_perturbation_attribution(model, graph, target=label, max_edges=64)
272
+
273
+ # For TensorGATLayer outputs.
274
+ out, attn = layer(x, edge_index, return_attention=True)
275
+ edge_scores = attention_to_edge_scores(attn, edge_index, head_reduce="mean")
276
+
277
+ # Patch-level heatmap from grid_shape metadata.
278
+ heatmap = patch_saliency_to_image_grid(sal, grid_shape=graph.metadata["grid_shape"])
279
+
280
+ # Export artefacts the dashboard can render (explicit paths only).
281
+ export_explanation_metadata("runs/demo/explanation_metadata.json",
282
+ method="saliency", target=int(label))
283
+ export_edge_scores_csv("runs/demo/explanation_edges.csv",
284
+ graph.edge_index, edge_scores, top_k=20)
285
+ ```
286
+
287
+ See [docs/explainability.md](docs/explainability.md) for examples and limits.
288
+
289
+ ---
290
+
291
+ ## Optional integrations
292
+
293
+ | Adapter | Install | Notes |
294
+ |---------|---------|-------|
295
+ | Native synthetic / folder datasets | (none) | Deterministic, learnable, no network |
296
+ | Torchvision-backed datasets | already a TGraphX base dependency | `MNIST`, `CIFAR-10/100`, `SVHN`, `STL-10`, `FakeData`, … converted to patch graphs |
297
+ | PyTorch Geometric | `pip install "tgraphx[pyg]"` | `Planetoid`, `TUDataset`, generic adapter; data-format converters only |
298
+ | DGL | follow upstream install | citation graphs, generic adapter |
299
+ | OGB | `pip install "tgraphx[ogb]"` | node / link / graph property prediction wrappers + `OGBEvaluatorWrapper` |
300
+ | MLflow | `pip install "tgraphx[mlflow]"` | `MLflowLogger`, lazy import |
301
+ | TensorBoard | `pip install "tgraphx[tracking]"` | `TensorBoardLogger`, lazy import |
302
+ | Hardware monitoring | `pip install "tgraphx[monitoring]"` | `psutil` + `pynvml` for the dashboard's hardware panel |
303
+
304
+ TGraphX is interoperable with the PyG / DGL / OGB ecosystems through small data-format converters; it is not a drop-in replacement for either framework.
305
+
306
+ ---
307
+
308
+ ## Backend and platform support
309
+
310
+ | Platform | Forward | torch.compile | AMP | CI coverage |
311
+ |----------|---------|--------------|-----|-------------|
312
+ | Linux + CPU | yes | yes | bfloat16 (recommended) | Full Ubuntu CI on Python 3.10 / 3.11 / 3.12 |
313
+ | NVIDIA CUDA | yes | yes | float16 / bfloat16 | Local tests; no GPU runners in CI |
314
+ | Apple Silicon MPS | yes | partial | partial | macOS smoke CI (import + build) |
315
+ | Windows + CPU | yes | yes | yes | Windows smoke CI (Python 3.11) |
316
+ | macOS + CPU | yes | yes | yes | macOS smoke CI (Python 3.11) |
317
+ | Multi-GPU (DDP) | helpers | user-managed | user-managed | `tgraphx.distributed` rank-zero / barrier helpers; full DDP setup is the user's responsibility |
318
+
319
+ For the AMP recommendations, dtype-cast policy, and per-platform caveats, see [docs/performance.md](docs/performance.md). For the precise API stability classification, see [docs/api_stability.md](docs/api_stability.md).
320
+
321
+ ---
322
+
323
+ ## Dashboard, local-first, privacy
324
+
325
+ TGraphX ships a local-first training dashboard that reads run artefacts (`metrics.csv`, `run_metadata.json`, `experiment_config.json`, `experiment_summary.json`, `dataset_metadata.json`, `transform_metadata.json`, `metrics_summary.json`, `benchmark_results.json`, `explanation_metadata.json`, `explanation_edges.csv`, `explanation_patch_heatmap.json`, `hetero_graph_metadata.json`, `temporal_metadata.json`, `sampling_metadata.json`, `hardware_report.json`).
326
+
327
+ ```bash
328
+ tgraphx-dashboard --logdir runs/demo
329
+ # → http://127.0.0.1:8765 (localhost only, no token needed)
330
+
331
+ tgraphx-dashboard --logdir runs/demo --host 0.0.0.0 --token MY_SECRET_TOKEN
332
+ tgraphx-dashboard --logdir runs/demo --export-html snapshot.html
333
+ ```
334
+
335
+ Properties:
336
+
337
+ * Off by default. The dashboard is opt-in; nothing about importing TGraphX runs a server.
338
+ * Local-first. Reads files from your `--logdir`; never executes code, never loads checkpoints, never runs models.
339
+ * No telemetry, no analytics, no external CDN; the offline HTML export is fully self-contained.
340
+ * LAN access requires `--token`; localhost mode does not.
341
+ * Path-traversal protected: every file read is validated against the resolved logdir.
342
+ * Background threads are launched only when you call `launch_dashboard_background(...)` explicitly.
343
+
344
+ Helpers for writing metadata files the dashboard understands:
345
+
346
+ ```python
347
+ from tgraphx import (
348
+ write_run_metadata, write_dataset_metadata, write_transform_metadata,
349
+ write_metrics_summary, write_benchmark_results,
350
+ write_explanation_metadata, write_experiment_config,
351
+ write_hardware_report, write_sampling_metadata,
352
+ write_hetero_graph_metadata, write_temporal_metadata,
353
+ )
354
+ ```
355
+
356
+ `write_graph_stats` from earlier releases is preserved.
357
+
358
+ See [docs/dashboard.md](docs/dashboard.md) for the full UI, security model, and offline export.
359
+
360
+ ---
361
+
362
+ ## Privacy summary
363
+
364
+ | Behaviour | Default |
365
+ |---|---|
366
+ | Telemetry / analytics | None — never |
367
+ | Remote calls at import | None |
368
+ | Dashboard | Off — launch explicitly |
369
+ | CSV / TensorBoard / MLflow logging | Off — create a logger explicitly |
370
+ | Hardware monitoring | Off — pass `include_hardware=True` to `env_report` |
371
+ | Checkpoints | Off — call `save_checkpoint` or attach `ModelCheckpoint` explicitly |
372
+ | Dataset downloads | Off — adapters require `download=True` |
373
+ | Background threads | None unless `launch_dashboard_background` is called |
374
+ | File writes | Only to paths the user provides |
375
+
376
+ No `~/.tgraphx` directory or user-level config is created.
377
+
378
+ ---
379
+
380
+ ## Examples and tutorials
381
+
382
+ ```bash
383
+ python examples/run_all_fast_examples.py # every CPU-safe demo
384
+ python examples/datasets_quickstart.py # registry + synthetic datasets
385
+ python examples/transforms_metrics_demo.py # Compose + classification report
386
+ python examples/synthetic_datasets_demo.py # all 7 native synthetic datasets
387
+ python examples/sampling_demo_v028.py # random walk + hetero + temporal sampling
388
+ python examples/training_with_dashboard.py # fit() + CSVLogger → dashboard
389
+ python examples/graph_transformer_demo.py # vector graph transformer
390
+ python examples/gat_chunking_demo.py # GAT chunked forward parity
391
+ ```
392
+
393
+ The full set of demos lives under `examples/` (see [examples/README.md](examples/README.md) when present).
394
+
395
+ ### Validation scripts
396
+
397
+ A small set of stand-alone validation scripts proves that the surfaces
398
+ TGraphX advertises actually work end-to-end:
399
+
400
+ | Script | Purpose |
401
+ |--------|---------|
402
+ | `examples/device_validation.py` | Runs vector + spatial layer smokes on CPU / CUDA / MPS, optionally under autocast (`--amp`). Emits a JSON report. |
403
+ | `examples/dashboard_artifact_validation.py` | Writes every supported dashboard metadata file, exports an offline HTML snapshot, and checks for CDN / token / `eval` leaks. |
404
+ | `examples/experiment_end_to_end_validation.py` | Trains a tiny synthetic experiment, asserts dashboard files exist, resumes from a checkpoint. |
405
+ | `examples/explainability_end_to_end_validation.py` | Trains, runs saliency / integrated gradients / edge perturbation, exports dashboard-readable explanation artefacts. |
406
+ | `examples/public_datasets/*.py` | Manual, opt-in scripts that exercise the torchvision / PyG / DGL / OGB adapters against real upstream loaders. They require `--download`, cap dataset size, skip cleanly if the optional package is missing, and never run in CI. |
407
+
408
+ See [docs/public_dataset_validation.md](docs/public_dataset_validation.md)
409
+ and [docs/device_validation.md](docs/device_validation.md) for the
410
+ exact invocations and policy.
411
+
412
+ ---
413
+
414
+ ## Boundaries
415
+
416
+ TGraphX is intentionally focused.
417
+
418
+ * TGraphX is not a drop-in replacement for PyG or DGL; the optional adapters convert data only.
419
+ * TGraphX provides DDP-aware helpers and a single-process smoke example, not an automatic multi-GPU training framework.
420
+ * Per-pixel and per-voxel GAT attention scores are not shipped — naive `[E, K, H, W]` score tensors are memory-prohibitive. Per-channel attention is shipped as `attention_mode="channel"`.
421
+ * Recurrent temporal memory modules (TGN, TGAT) are not shipped; temporal workflows use a stateless snapshot-loop pattern.
422
+ * Synthetic datasets are sanity / tutorial datasets, not benchmarks; benchmark scripts are reproducibility tools, not real-world performance comparisons.
423
+ * `kNN`, `radius`, `IoU`, and fully-connected graph builders are mathematically `O(N²)` and warn on large `N`; chunked variants reduce peak memory.
424
+ * Universal arbitrary-rank node-feature support across every layer is a future direction; the supported layouts today are vector `[N, D]`, 2-D spatial `[N, C, H, W]`, and 3-D volumetric `[N, C, D, H, W]`.
425
+
426
+ Detailed limitations live in [docs/limitations.md](docs/limitations.md); the roadmap is in [docs/roadmap.md](docs/roadmap.md).
427
+
428
+ ---
429
+
430
+ ## Citation
431
+
432
+ ```bibtex
433
+ @misc{sajjadi2025tgraphxtensorawaregraphneural,
434
+ title={TGraphX: Tensor-Aware Graph Neural Network for Multi-Dimensional Feature Learning},
435
+ author={Arash Sajjadi and Mark Eramian},
436
+ year={2025},
437
+ eprint={2504.03953},
438
+ archivePrefix={arXiv},
439
+ primaryClass={cs.CV},
440
+ url={https://arxiv.org/abs/2504.03953},
441
+ }
442
+ ```
443
+
444
+ ---
445
+
446
+ ## Authorship
447
+
448
+ **Software author and maintainer:** Arash Sajjadi, PhD Candidate in Computer Science, University of Saskatchewan ([arash.sajjadi@usask.ca](mailto:arash.sajjadi@usask.ca)).
449
+ **Academic supervision:** Mark Eramian, PhD supervisor / academic advisor, University of Saskatchewan.
450
+
451
+ ---
452
+
453
+ ## License
454
+
455
+ TGraphX is released under the [MIT License](LICENSE).