pyg-nightly 2.7.0.dev20241027__py3-none-any.whl → 2.7.0.dev20241031__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyg-nightly
3
- Version: 2.7.0.dev20241027
3
+ Version: 2.7.0.dev20241031
4
4
  Summary: Graph Neural Network Library for PyTorch
5
5
  Keywords: deep-learning,pytorch,geometric-deep-learning,graph-neural-networks,graph-convolutional-networks
6
6
  Author-email: Matthias Fey <matthias@pyg.org>
@@ -1,4 +1,4 @@
1
- torch_geometric/__init__.py,sha256=Tl6uetEmnPxV5lTY2_aTfQfUqH0ggFyNrrLX9G8gOy0,1904
1
+ torch_geometric/__init__.py,sha256=xvSZWRVIrP2K51ajiMdBNakse3Y6lz77Si0TgGfAPVo,1904
2
2
  torch_geometric/_compile.py,sha256=REjj1_qX8YBrva6iqr3AsNiDueTAy2BhLZkdezKL2MY,1322
3
3
  torch_geometric/_onnx.py,sha256=V9ffrIKSqhDw6xUZ12lkuSfNs48cQp2EeJ6Z19GfnVw,349
4
4
  torch_geometric/backend.py,sha256=lVaf7aLoVaB3M-UcByUJ1G4T4FOK6LXAg0CF4W3E8jo,1575
@@ -11,7 +11,7 @@ torch_geometric/edge_index.py,sha256=r4_24Rhm3YCK0BF-kzLvL7PlY_1tWcXrBDIr7JPDjkw
11
11
  torch_geometric/experimental.py,sha256=JbtNNEXjFGI8hZ9raM6-qrZURP6Z5nlDK8QicZUIbz0,4756
12
12
  torch_geometric/home.py,sha256=EV54B4Dmiv61GDbkCwtCfWGWJ4eFGwZ8s3KOgGjwYgY,790
13
13
  torch_geometric/index.py,sha256=9ChzWFCwj2slNcVBOgfV-wQn-KscJe_y7502w-Vf76w,24045
14
- torch_geometric/inspector.py,sha256=9M61T9ruSid5-r2aelRAeX9g_7AZ1VMnYAB2KozM71E,19267
14
+ torch_geometric/inspector.py,sha256=nKi5o4Mn6xsG0Ex1GudTEQt_EqnF9mcMqGtp7Shh9sQ,19336
15
15
  torch_geometric/isinstance.py,sha256=truZjdU9PxSvjJ6k0d_CLJ2iOpen2o8U-54pbUbNRyE,935
16
16
  torch_geometric/lazy_loader.py,sha256=SM0UcXtIdiFge75MKBAWXedoiSOdFDOV0rm1PfoF9cE,908
17
17
  torch_geometric/logging.py,sha256=HmHHLiCcM64k-6UYNOSfXPIeSGNAyiGGcn8cD8tlyuQ,858
@@ -149,7 +149,7 @@ torch_geometric/datasets/tosca.py,sha256=nUSF8NQT1GlkwWQLshjWmr8xORsvRHzzIqhUyDC
149
149
  torch_geometric/datasets/tu_dataset.py,sha256=14OSaXBgVwT1dX2h1wZ3xVIwoo0GQBEfR3yWh6Q0VF0,7847
150
150
  torch_geometric/datasets/twitch.py,sha256=qfEerf-Uaojx2ZvegENowdG4E7RoUT_HUO9xtULadvo,3658
151
151
  torch_geometric/datasets/upfd.py,sha256=crqO8uQNz1wC1JOn4prSs8iOGv9LuLK3dZf_KUV9tUE,7010
152
- torch_geometric/datasets/web_qsp_dataset.py,sha256=3f2x9XlbC1QhEsr_9hoQHCE9_7f9Poy1xpsBpONSY6s,8614
152
+ torch_geometric/datasets/web_qsp_dataset.py,sha256=tCVMFRT1FqlukkrdcN-qS2jYWvVYocy3-_ZeCpWwIEk,8905
153
153
  torch_geometric/datasets/webkb.py,sha256=beC1kWeW7cIjYwWyaINQSk-3lmVR85Lus7cKZniHp8Y,4879
154
154
  torch_geometric/datasets/wikics.py,sha256=iTzYif1WvbMXnMdhPMfvrkVaAbnM009WiB_f_JWZqhU,3879
155
155
  torch_geometric/datasets/wikidata.py,sha256=9mYShF_HlpTmcdLpiaP_tYJ9eQtUOu5vRPvohN6RXqI,4979
@@ -320,7 +320,7 @@ torch_geometric/nn/aggr/patch_transformer.py,sha256=SP--1IaXrHWjjGgH7yIPeO84b5NA
320
320
  torch_geometric/nn/aggr/quantile.py,sha256=sRnKyt4CXr9RmjoPyTl4VUvXgSCMl9PG-fhCGsSZ76c,6189
321
321
  torch_geometric/nn/aggr/scaler.py,sha256=GV6gxUFBoKYMQTGybwzoPh708OY6k6chtUYmCIbFGXk,4638
322
322
  torch_geometric/nn/aggr/set2set.py,sha256=4GdmsjbBIrap3CG2naeFNsYe5eE-fhrNQOXM1-TIxyM,2446
323
- torch_geometric/nn/aggr/set_transformer.py,sha256=T30oGDQ9ZNihiKUW4EeeU1RpZpVy2W3jjwMEXJI405k,4207
323
+ torch_geometric/nn/aggr/set_transformer.py,sha256=FG7_JizpFX14M6VSCwLSjYXYdJ1ZiQVbvnaYHIraiuM,4213
324
324
  torch_geometric/nn/aggr/sort.py,sha256=bvOOWnFkNOBOZih4rqVZQsjfeDX3vmXo1bpPSFD846w,2507
325
325
  torch_geometric/nn/aggr/utils.py,sha256=CLJ-ZrVWYIOBpdhQBLAz94dj3cMKKKc3qwGr4DFbiCU,8338
326
326
  torch_geometric/nn/aggr/variance_preserving.py,sha256=fu-U_aGYpVLpgSFvVg0ONMe6nqoyv8tZ6Y35qMYTf9w,1126
@@ -426,11 +426,11 @@ torch_geometric/nn/models/correct_and_smooth.py,sha256=wmq-US2r4ocd0a661R8YeDiBe
426
426
  torch_geometric/nn/models/deep_graph_infomax.py,sha256=u6j-5-iHBASDCZ776dyfCI1N8wuvIMjeff8kthiX3Q4,4137
427
427
  torch_geometric/nn/models/deepgcn.py,sha256=tIgT03cj8MghYlxEozpoGvGG_CwpJrGDxv1Z0CVIUts,4339
428
428
  torch_geometric/nn/models/dimenet.py,sha256=Kc5p-rB5q-0e8lY22l-OdQTscTxJh2lTEpeRFMdL4RY,36186
429
- torch_geometric/nn/models/dimenet_utils.py,sha256=xP_nbzkSSL25GC3rrZ9KP8x9QZ59S-CZuHzCmQ-K0fI,5062
429
+ torch_geometric/nn/models/dimenet_utils.py,sha256=Eyn_EiJqwKvuYj6BtRpSxrzMG3v4Gk98X9MxZ7uvwm4,5069
430
430
  torch_geometric/nn/models/g_retriever.py,sha256=VueRImNJlh1WvRWcsSXliSw8RlxlzWlu2WSFs_VQaJc,7749
431
431
  torch_geometric/nn/models/gnnff.py,sha256=15dkiLgy0LmH1hnUrpeoHioIp4BPTfjpVATpnGRt9E0,7860
432
432
  torch_geometric/nn/models/graph_mixer.py,sha256=mthMeCOikR8gseEsu4oJ3Cd9C35zHSv1p32ROwnG-6s,9246
433
- torch_geometric/nn/models/graph_unet.py,sha256=WFb7d_DBByMGyXh3AdK2CKNmvMmSKsSUt8l8UnSOovs,5395
433
+ torch_geometric/nn/models/graph_unet.py,sha256=N8TSmJo8AlbZjjcame0xW_jZvMOirL5ahw6qv5Yjpbs,5586
434
434
  torch_geometric/nn/models/jumping_knowledge.py,sha256=9JR2EoViXKjcDSLb8tjJm-UHfv1mQCJvZAAEsYa0Ocw,5496
435
435
  torch_geometric/nn/models/label_prop.py,sha256=6XYBKp7OLmUgcn-73jXXpYZpef9Za1m0gI9QLv2bMEw,3908
436
436
  torch_geometric/nn/models/lightgcn.py,sha256=dXKiBvM96jGKLtYp4l90Fko4he0kKdR9fRw-0ZCqSrA,12466
@@ -618,6 +618,6 @@ torch_geometric/utils/undirected.py,sha256=H_nfpI0_WluOG6VfjPyldvcjL4w5USAKWu2x5
618
618
  torch_geometric/visualization/__init__.py,sha256=PyR_4K5SafsJrBr6qWrkjKr6GBL1b7FtZybyXCDEVwY,154
619
619
  torch_geometric/visualization/graph.py,sha256=AGKqbtTdL14w7xIhy6n3g4bpCOnujKt-pXHCNzovxB4,4784
620
620
  torch_geometric/visualization/influence.py,sha256=CWMvuNA_Nf1sfbJmQgn58yS4OFpeKXeZPe7kEuvkUBw,477
621
- pyg_nightly-2.7.0.dev20241027.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
622
- pyg_nightly-2.7.0.dev20241027.dist-info/METADATA,sha256=V-YB9GMG8CPMfeS_IUVL_vtYQ1TluM7FX4F-l-WcO_o,62897
623
- pyg_nightly-2.7.0.dev20241027.dist-info/RECORD,,
621
+ pyg_nightly-2.7.0.dev20241031.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
622
+ pyg_nightly-2.7.0.dev20241031.dist-info/METADATA,sha256=XtBSCkGeEBikzpALrIyETHTimwYY8mA6TyiERxECr7E,62897
623
+ pyg_nightly-2.7.0.dev20241031.dist-info/RECORD,,
@@ -30,7 +30,7 @@ from .lazy_loader import LazyLoader
30
30
  contrib = LazyLoader('contrib', globals(), 'torch_geometric.contrib')
31
31
  graphgym = LazyLoader('graphgym', globals(), 'torch_geometric.graphgym')
32
32
 
33
- __version__ = '2.7.0.dev20241027'
33
+ __version__ = '2.7.0.dev20241031'
34
34
 
35
35
  __all__ = [
36
36
  'Index',
@@ -21,12 +21,6 @@ def retrieval_via_pcst(
21
21
  cost_e: float = 0.5,
22
22
  ) -> Tuple[Data, str]:
23
23
  c = 0.01
24
- if len(textual_nodes) == 0 or len(textual_edges) == 0:
25
- desc = textual_nodes.to_csv(index=False) + "\n" + textual_edges.to_csv(
26
- index=False,
27
- columns=["src", "edge_attr", "dst"],
28
- )
29
- return data, desc
30
24
 
31
25
  from pcst_fast import pcst_fast
32
26
 
@@ -135,13 +129,17 @@ class WebQSPDataset(InMemoryDataset):
135
129
  If :obj:`"test"`, loads the test dataset. (default: :obj:`"train"`)
136
130
  force_reload (bool, optional): Whether to re-process the dataset.
137
131
  (default: :obj:`False`)
132
+ use_pcst (bool, optional): Whether to preprocess the dataset's graph
133
+ with PCST or return the full graphs. (default: :obj:`True`)
138
134
  """
139
135
  def __init__(
140
136
  self,
141
137
  root: str,
142
138
  split: str = "train",
143
139
  force_reload: bool = False,
140
+ use_pcst: bool = True,
144
141
  ) -> None:
142
+ self.use_pcst = use_pcst
145
143
  super().__init__(root, force_reload=force_reload)
146
144
 
147
145
  if split not in {'train', 'val', 'test'}:
@@ -224,15 +222,22 @@ class WebQSPDataset(InMemoryDataset):
224
222
  edge_index=edge_index,
225
223
  edge_attr=edge_attr,
226
224
  )
227
- data, desc = retrieval_via_pcst(
228
- data,
229
- question_embs[i],
230
- nodes,
231
- edges,
232
- topk=3,
233
- topk_e=5,
234
- cost_e=0.5,
235
- )
225
+ if self.use_pcst and len(nodes) > 0 and len(edges) > 0:
226
+ data, desc = retrieval_via_pcst(
227
+ data,
228
+ question_embs[i],
229
+ nodes,
230
+ edges,
231
+ topk=3,
232
+ topk_e=5,
233
+ cost_e=0.5,
234
+ )
235
+ else:
236
+ desc = nodes.to_csv(index=False) + "\n" + edges.to_csv(
237
+ index=False,
238
+ columns=["src", "edge_attr", "dst"],
239
+ )
240
+
236
241
  data.question = question
237
242
  data.label = label
238
243
  data.desc = desc
@@ -448,6 +448,10 @@ def type_repr(obj: Any, _globals: Dict[str, Any]) -> str:
448
448
  return '...'
449
449
 
450
450
  if obj.__module__ == 'typing': # Special logic for `typing.*` types:
451
+
452
+ if not hasattr(obj, '_name'):
453
+ return repr(obj)
454
+
451
455
  name = obj._name
452
456
  if name is None: # In some cases, `_name` is not populated.
453
457
  name = str(obj.__origin__).split('.')[-1]
@@ -38,7 +38,7 @@ class SetTransformerAggregation(Aggregation):
38
38
  (default: :obj:`1`)
39
39
  concat (bool, optional): If set to :obj:`False`, the seed embeddings
40
40
  are averaged instead of concatenated. (default: :obj:`True`)
41
- norm (str, optional): If set to :obj:`True`, will apply layer
41
+ layer_norm (str, optional): If set to :obj:`True`, will apply layer
42
42
  normalization. (default: :obj:`False`)
43
43
  dropout (float, optional): Dropout probability of attention weights.
44
44
  (default: :obj:`0`)
@@ -1,5 +1,7 @@
1
1
  # Shameless steal from: https://github.com/klicperajo/dimenet
2
2
 
3
+ import math
4
+
3
5
  import numpy as np
4
6
  import sympy as sym
5
7
  from scipy import special as sp
@@ -62,8 +64,8 @@ def bessel_basis(n, k):
62
64
 
63
65
 
64
66
  def sph_harm_prefactor(k, m):
65
- return ((2 * k + 1) * np.math.factorial(k - abs(m)) /
66
- (4 * np.pi * np.math.factorial(k + abs(m))))**0.5
67
+ return ((2 * k + 1) * math.factorial(k - abs(m)) /
68
+ (4 * np.pi * math.factorial(k + abs(m))))**0.5
67
69
 
68
70
 
69
71
  def associated_legendre_polynomials(k, zero_m_only=True):
@@ -79,12 +79,21 @@ class GraphUNet(torch.nn.Module):
79
79
  for conv in self.up_convs:
80
80
  conv.reset_parameters()
81
81
 
82
- def forward(self, x: Tensor, edge_index: Tensor,
83
- batch: OptTensor = None) -> Tensor:
82
+ def forward(
83
+ self,
84
+ x: Tensor,
85
+ edge_index: Tensor,
86
+ batch: OptTensor = None,
87
+ edge_weight: Tensor = None,
88
+ ) -> Tensor:
84
89
  """""" # noqa: D419
85
90
  if batch is None:
86
91
  batch = edge_index.new_zeros(x.size(0))
87
- edge_weight = x.new_ones(edge_index.size(1))
92
+
93
+ if edge_weight is None:
94
+ edge_weight = x.new_ones(edge_index.size(1))
95
+ assert edge_weight.dim() == 1
96
+ assert edge_weight.size(0) == edge_index.size(1)
88
97
 
89
98
  x = self.down_convs[0](x, edge_index, edge_weight)
90
99
  x = self.act(x)