From 811d0bc87454ff69e0ca1d3ff104c89618107a79 Mon Sep 17 00:00:00 2001
From: nyLiao <39255546+nyLiao@users.noreply.github.com>
Date: Sat, 27 Jul 2024 22:52:05 +0800
Subject: [PATCH] Improve logging
---
benchmark/trainer/load_data.py | 4 ++--
benchmark/utils/logger.py | 4 ++++
docs/source/index.rst | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/benchmark/trainer/load_data.py b/benchmark/trainer/load_data.py
index 70415d5..528e394 100755
--- a/benchmark/trainer/load_data.py
+++ b/benchmark/trainer/load_data.py
@@ -174,7 +174,7 @@ def _resolve_import(self, args: Namespace) -> Tuple[str, str, dict]:
else:
self.metric = 's_f1i'
if self.data not in ['snap-patents']:
- self._T_insert(T.ToUndirected(), index=0)
+ kwargs['transform'] = self._T_insert(T.ToUndirected(), index=0)
elif self.data in ['penn94', 'amherst41', 'cornell5', 'johns_hopkins55', 'reed98']:
module_name = 'dataset_process'
class_name = 'FB100'
@@ -202,7 +202,7 @@ def _resolve_import(self, args: Namespace) -> Tuple[str, str, dict]:
kwargs = dict(
root=DATAPATH.joinpath('PyG'),
name=self.data,
- transform=self.transform,)
+ transform=self._T_insert(T.ToUndirected(), index=0),)
pyg_mapping = {
'cora': 'Planetoid',
'citeseer': 'Planetoid',
diff --git a/benchmark/utils/logger.py b/benchmark/utils/logger.py
index 4756ecc..7e807c5 100755
--- a/benchmark/utils/logger.py
+++ b/benchmark/utils/logger.py
@@ -219,6 +219,7 @@ def merge(self,
logger.data.index = rows
if suffix:
logger.data.columns = [f'{coli}_{suffix}' for coli in logger.data.columns]
+ logger.fmt.index = [f'{coli}_{suffix}' for coli in logger.fmt.index]
self._set(logger.data, logger.fmt)
return self
@@ -336,3 +337,6 @@ def get_str(self,
def __str__(self) -> str:
r"""String for print on screen."""
return self.get_str(maxlen=80)
+
+ def __repr__(self) -> str:
+ return self.get_str()
diff --git a/docs/source/index.rst b/docs/source/index.rst
index b173ea6..2f1f7fe 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -9,7 +9,7 @@ pyg_spectral
| 🔍 `Documentation `__
| 👾 `GitHub `__ |gh-bn|
- | 📄 `Paper `__
+ | 📄 `Paper `__
| 📎 `Citation `__
``pyg_spectral`` is a `PyG `_-based framework for analyzing, implementing, and benchmarking spectral GNNs with effectiveness and efficiency evaluations.