From 2a466c8983f9ac21e15ad4831b1bfb9604ee0fb7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 22:18:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 1 + test/nn/kge/test_transf.py | 2 +- torch_geometric/nn/kge/__init__.py | 7 +------ torch_geometric/nn/kge/transf.py | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7fa81c5916c1..c11ce1948b23 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ Unlike simple stacking of GNN layers, these models could involve pre-processing, - **[DistMult](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.kge.DistMult.html)** from Yang *et al.*: [Embedding Entities and Relations for Learning and Inference in Knowledge Bases](https://arxiv.org/abs/1412.6575) (ICLR 2015) \[[**Example**](https://github.com/pyg-team/pytorch_geometric/blob/master/examples/kge_fb15k_237.py)\] - **[RotatE](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.kge.RotatE.html)** from Sun *et al.*: [RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space](https://arxiv.org/abs/1902.10197) (ICLR 2019) \[[**Example**](https://github.com/pyg-team/pytorch_geometric/blob/master/examples/kge_fb15k_237.py)\] - **[TransF](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.nn.kge.TransF.html)** from Ji *et al.*: [Knowledge Graph Embedding by Flexible Translation](https://cdn.aaai.org/ocs/12887/12887-57589-1-PB.pdf) (ACL 2015) \[[**Example**](https://github.com/pyg-team/pytorch_geometric/blob/master/examples/kge_fb15k_237.py)\] + **GNN operators and utilities:** diff --git a/test/nn/kge/test_transf.py b/test/nn/kge/test_transf.py index ce977682d8dd..7952afbe6f6f 100644 --- a/test/nn/kge/test_transf.py +++ b/test/nn/kge/test_transf.py @@ -22,4 +22,4 @@ def test_transf(): mean_rank, mrr, hits = model.test(h, r, t, batch_size=5, log=False) assert 0 <= mean_rank <= 10 assert 0 < mrr <= 1 - assert hits == 1.0 \ No newline at end of file + assert hits == 1.0 diff --git a/torch_geometric/nn/kge/__init__.py b/torch_geometric/nn/kge/__init__.py index 9d365ff80f86..566303e9316b 100644 --- a/torch_geometric/nn/kge/__init__.py +++ b/torch_geometric/nn/kge/__init__.py @@ -8,10 +8,5 @@ from .transf import TransF __all__ = classes = [ - 'KGEModel', - 'TransE', - 'ComplEx', - 'DistMult', - 'RotatE', - 'TransF' + 'KGEModel', 'TransE', 'ComplEx', 'DistMult', 'RotatE', 'TransF' ] diff --git a/torch_geometric/nn/kge/transf.py b/torch_geometric/nn/kge/transf.py index 31240f56a372..b38aa59855d3 100644 --- a/torch_geometric/nn/kge/transf.py +++ b/torch_geometric/nn/kge/transf.py @@ -6,9 +6,9 @@ from torch_geometric.nn.kge import KGEModel + class TransF(KGEModel): - r""" - The TransF model from the "Knowledge Graph Embedding by Flexible + r"""The TransF model from the "Knowledge Graph Embedding by Flexible Translation" paper. :class:`TransF` introduces a flexible translation mechanism by dynamically