You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graphs generated with FakeHeteroDataset have a higher mean node degree than specified with the avg_degree parameter. If averaged over sufficiently many graphs, I would expect the mean node degree to converge to the avg_degree parameter. However, this is not true, as inestigated with the MRE:
import torch_geometric as tg
import numpy as np
import matplotlib.pyplot as plt
MAX_AVR_DEGREE = 15
SAMPLES_PER_STEP = 100
mean_degrees = {}
for i in np.arange(1,MAX_AVR_DEGREE):
mean_degrees[i] = []
for _ in range(SAMPLES_PER_STEP):
data = tg.datasets.FakeDataset(avg_num_nodes=32, avg_degree=i)
mean_degree = tg.utils.degree(data.edge_index[0]).mean() # data.edge_index.shape[1] / data.x.shape[0]
mean_degrees[i].append(mean_degree)
mean_degrees = {k:np.mean(v) for k, v in mean_degrees.items()}
plt.scatter(np.arange(1, MAX_AVR_DEGREE), mean_degrees.values())
plt.xlabel('avg_degree')
plt.ylabel('Mean (over samples) mean (over nodes) degree')
Resulting plot:
As visible the specified avg_degree (x axis) and computed mean degree (y axis) diverge. This seems like unintended behavior.
Versions
Collecting environment information...
PyTorch version: 2.5.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 14.4.1 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: Could not collect
Libc version: N/A
Python version: 3.11.0 | packaged by conda-forge | (main, Jan 14 2023, 12:26:40) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-14.4.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
🐛 Describe the bug
Graphs generated with
FakeHeteroDataset
have a higher mean node degree than specified with theavg_degree
parameter. If averaged over sufficiently many graphs, I would expect the mean node degree to converge to theavg_degree
parameter. However, this is not true, as inestigated with the MRE:Resulting plot:
As visible the specified avg_degree (x axis) and computed mean degree (y axis) diverge. This seems like unintended behavior.
Versions
Collecting environment information...
PyTorch version: 2.5.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 14.4.1 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: Could not collect
Libc version: N/A
Python version: 3.11.0 | packaged by conda-forge | (main, Jan 14 2023, 12:26:40) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-14.4.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Apple M1
Versions of relevant libraries:
[pip3] flake8==7.0.0
[pip3] mypy==1.8.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] numpydoc==1.5.0
[pip3] torch==2.5.1
[pip3] torch-geometric==2.6.1
[conda] numpy 1.26.4 py311he598dae_0
[conda] numpy-base 1.26.4 py311hfbfe69c_0
[conda] numpydoc 1.5.0 py311hca03da5_0
[conda] torch 2.5.1 pypi_0 pypi
[conda] torch-geometric 2.6.1 pypi_0 pypi
The text was updated successfully, but these errors were encountered: