From 584e5808713034e0e75805c30285c635abe6bed1 Mon Sep 17 00:00:00 2001 From: linlin Date: Sat, 4 Apr 2020 12:48:57 +0200 Subject: [PATCH 1/4] Update issue templates --- .github/ISSUE_TEMPLATE/issue-template.md | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/issue-template.md diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md new file mode 100644 index 0000000000..e3fe8bff44 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -0,0 +1,30 @@ +--- +name: Issue template +about: Issue template +title: '' +labels: '' +assignees: '' + +--- + + + +### Reproducing code example: + + + +```python +import gklearn +<< your code here >> +``` + + + +### Error message: + + + +### graphkit-learn/Python version information: + + From 375cc34243e39be83b14e2dc06c4f8ea665107e0 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Sat, 12 Feb 2022 10:42:35 +0000 Subject: [PATCH 2/4] Add Gitter badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ff792aff7..7bfc620ebd 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build status](https://ci.appveyor.com/api/projects/status/bdxsolk0t1uji9rd?svg=true)](https://ci.appveyor.com/project/jajupmochi/graphkit-learn) [![codecov](https://codecov.io/gh/jajupmochi/graphkit-learn/branch/master/graph/badge.svg)](https://codecov.io/gh/jajupmochi/graphkit-learn) [![Documentation Status](https://readthedocs.org/projects/graphkit-learn/badge/?version=master)](https://graphkit-learn.readthedocs.io/en/master/?badge=master) -[![PyPI version](https://badge.fury.io/py/graphkit-learn.svg)](https://badge.fury.io/py/graphkit-learn) +[![PyPI version](https://badge.fury.io/py/graphkit-learn.svg)](https://badge.fury.io/py/graphkit-learn) [![Join the chat at https://gitter.im/graphkit-learn/graphkit-learn](https://badges.gitter.im/graphkit-learn/graphkit-learn.svg)](https://gitter.im/graphkit-learn/graphkit-learn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) A Python package for graph kernels, graph edit distances and graph pre-image problem. From 0af57092a37cb1941a38602ee939d69f5a8f3457 Mon Sep 17 00:00:00 2001 From: linlin Date: Sat, 12 Feb 2022 11:46:18 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bfc620ebd..743d2c5766 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ [![Build status](https://ci.appveyor.com/api/projects/status/bdxsolk0t1uji9rd?svg=true)](https://ci.appveyor.com/project/jajupmochi/graphkit-learn) [![codecov](https://codecov.io/gh/jajupmochi/graphkit-learn/branch/master/graph/badge.svg)](https://codecov.io/gh/jajupmochi/graphkit-learn) [![Documentation Status](https://readthedocs.org/projects/graphkit-learn/badge/?version=master)](https://graphkit-learn.readthedocs.io/en/master/?badge=master) -[![PyPI version](https://badge.fury.io/py/graphkit-learn.svg)](https://badge.fury.io/py/graphkit-learn) [![Join the chat at https://gitter.im/graphkit-learn/graphkit-learn](https://badges.gitter.im/graphkit-learn/graphkit-learn.svg)](https://gitter.im/graphkit-learn/graphkit-learn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![PyPI version](https://badge.fury.io/py/graphkit-learn.svg)](https://badge.fury.io/py/graphkit-learn) +[![Join the chat at https://gitter.im/graphkit-learn/graphkit-learn](https://badges.gitter.im/graphkit-learn/graphkit-learn.svg)](https://gitter.im/graphkit-learn/graphkit-learn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) A Python package for graph kernels, graph edit distances and graph pre-image problem. From 32e8ccf2c2a62eab048e1111ac5118ff3af18b49 Mon Sep 17 00:00:00 2001 From: Gauzere Benoit Date: Thu, 19 Oct 2023 21:41:28 +0200 Subject: [PATCH 4/4] patch for computation of treelet kernel: intersection does not induce semi definite positiveness of Gram Matrix --- gklearn/kernels/treelet.py | 16 ++++------------ gklearn/kernels/treeletKernel.py | 6 +++--- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/gklearn/kernels/treelet.py b/gklearn/kernels/treelet.py index c9e890c18e..184fbfde27 100644 --- a/gklearn/kernels/treelet.py +++ b/gklearn/kernels/treelet.py @@ -452,20 +452,12 @@ def _kernel_do(self, canonkey1, canonkey2): kernel : float Treelet kernel between 2 graphs. """ - keys = set(canonkey1.keys()) & set( - canonkey2.keys() - ) # find same canonical keys in both graphs + keys = set(canonkey1.keys()) | set(canonkey2.keys()) # find same canonical keys in both graphs if len(keys) == 0: # There is nothing in common... - return 0 + return 0 - vector1 = np.array( - [(canonkey1[key] if (key in canonkey1.keys()) else 0) for key in - keys] - ) - vector2 = np.array( - [(canonkey2[key] if (key in canonkey2.keys()) else 0) for key in - keys] - ) + vector1 = np.array([canonkey1.get(key,0) for key in keys]) + vector2 = np.array([canonkey2.get(key,0)for key in keys]) # vector1, vector2 = [], [] # keys1, keys2 = canonkey1, canonkey2 diff --git a/gklearn/kernels/treeletKernel.py b/gklearn/kernels/treeletKernel.py index 14577ff5bd..ba3450350b 100644 --- a/gklearn/kernels/treeletKernel.py +++ b/gklearn/kernels/treeletKernel.py @@ -160,9 +160,9 @@ def _treeletkernel_do(canonkey1, canonkey2, sub_kernel): kernel : float Treelet Kernel between 2 graphs. """ - keys = set(canonkey1.keys()) & set(canonkey2.keys()) # find same canonical keys in both graphs - vector1 = np.array([(canonkey1[key] if (key in canonkey1.keys()) else 0) for key in keys]) - vector2 = np.array([(canonkey2[key] if (key in canonkey2.keys()) else 0) for key in keys]) + keys = set(canonkey1.keys()) | set(canonkey2.keys()) # find union of canonical keys in both graphs + vector1 = np.array([canonkey1.get(key,0) for key in keys]) + vector2 = np.array([canonkey2.get(key,0) for key in keys]) kernel = sub_kernel(vector1, vector2) return kernel