Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix treelet #58

Merged
merged 50 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0024d6a
Merge pull request #4 from jajupmochi/v0.2
jajupmochi Apr 2, 2020
584e580
Update issue templates
jajupmochi Apr 4, 2020
1a652e5
Merge pull request #5 from jajupmochi/v0.2
jajupmochi Apr 7, 2020
376418d
Merge pull request #7 from jajupmochi/v0.2
jajupmochi Apr 7, 2020
3deb319
Merge pull request #8 from jajupmochi/v0.2
jajupmochi Apr 7, 2020
9de092d
Merge pull request #9 from jajupmochi/v0.2
jajupmochi Apr 7, 2020
ec682bb
Merge pull request #10 from jajupmochi/v0.2
jajupmochi Apr 8, 2020
8efc673
Merge pull request #11 from jajupmochi/v0.2
jajupmochi Apr 10, 2020
ee5c784
Merge pull request #12 from jajupmochi/v0.2
jajupmochi Apr 10, 2020
84ebbcd
Merge pull request #13 from jajupmochi/v0.2
jajupmochi Apr 10, 2020
1151e80
Merge pull request #14 from jajupmochi/v0.2
jajupmochi Apr 10, 2020
3635dcc
Merge pull request #15 from jajupmochi/v0.2
jajupmochi Apr 12, 2020
3970ede
Merge pull request #16 from jajupmochi/v0.2
jajupmochi Apr 14, 2020
eadc91b
Merge pull request #17 from jajupmochi/v0.2
jajupmochi Apr 28, 2020
55aef2b
Merge pull request #18 from jajupmochi/v0.2
jajupmochi May 27, 2020
d8708eb
Merge pull request #19 from jajupmochi/v0.2
jajupmochi Jun 23, 2020
89ba98b
Merge pull request #20 from jajupmochi/v0.2
jajupmochi Jun 23, 2020
b1ae62a
Merge pull request #21 from jajupmochi/v0.2
jajupmochi Jun 24, 2020
6f0c1df
Merge pull request #22 from jajupmochi/v0.2
jajupmochi Jun 25, 2020
b649298
Merge pull request #23 from jajupmochi/v0.2
jajupmochi Jul 6, 2020
0c01cb3
Merge pull request #25 from jajupmochi/v0.2
jajupmochi Sep 25, 2020
e9cec0a
Merge pull request #26 from jajupmochi/v0.2
jajupmochi Sep 25, 2020
be4f169
Merge pull request #27 from jajupmochi/v0.2
jajupmochi Sep 25, 2020
068b57a
Merge pull request #28 from jajupmochi/v0.2
jajupmochi Sep 28, 2020
e4fe9fe
Merge pull request #29 from jajupmochi/v0.2
jajupmochi Oct 2, 2020
5f06a1a
Merge pull request #30 from jajupmochi/v0.2.x
jajupmochi Oct 2, 2020
27f2c44
Merge pull request #33 from jajupmochi/v0.2.x
jajupmochi Oct 15, 2020
2c36da0
Merge pull request #34 from jajupmochi/v0.2.x
jajupmochi Oct 16, 2020
8cbd743
Merge pull request #35 from jajupmochi/v0.2.x
jajupmochi Oct 16, 2020
f95c54e
Merge pull request #36 from jajupmochi/v0.2.x
jajupmochi Oct 19, 2020
1841358
Merge pull request #37 from jajupmochi/v0.2.x
jajupmochi Nov 2, 2020
6e883f8
Merge pull request #38 from jajupmochi/v0.2.x
jajupmochi Nov 12, 2020
50ab7aa
Merge pull request #39 from jajupmochi/v0.2.x
jajupmochi Dec 14, 2020
d270639
Merge pull request #40 from jajupmochi/v0.2.x
jajupmochi Dec 26, 2020
e9154d5
Merge pull request #42 from jajupmochi/v0.2.x
jajupmochi Dec 30, 2020
44bdcd6
Merge pull request #43 from jajupmochi/v0.2.x
jajupmochi Jan 1, 2021
830f96a
Merge pull request #44 from jajupmochi/v0.2.x
jajupmochi Jan 18, 2021
cd98b12
Merge pull request #45 from jajupmochi/v0.2.x
jajupmochi Jan 25, 2021
e1fe40d
Merge pull request #46 from jajupmochi/v0.2.x
jajupmochi Nov 30, 2021
375cc34
Add Gitter badge
gitter-badger Feb 12, 2022
074a3f3
Merge pull request #47 from gitter-badger/gitter-badge
jajupmochi Feb 12, 2022
0af5709
Update README.md
jajupmochi Feb 12, 2022
8b85389
Merge pull request #48 from jajupmochi/v0.2.x
jajupmochi Jun 24, 2022
6dd9e1b
Merge pull request #51 from jajupmochi/v0.2.x
jajupmochi Apr 19, 2023
d6ea77d
Merge pull request #52 from jajupmochi/v0.2.x
jajupmochi Apr 20, 2023
6f07d0d
Merge pull request #53 from jajupmochi/v0.2.x
jajupmochi Apr 28, 2023
1d154cc
Merge pull request #54 from jajupmochi/v0.2.x
jajupmochi Aug 14, 2023
32e8ccf
patch for computation of treelet kernel: intersection does not induce…
bgauzere Oct 19, 2023
e735e9a
Merge pull request #57 from jajupmochi/v0.2.x
jajupmochi Dec 6, 2023
f543eb1
Merge pull request #55 from bgauzere/master
jajupmochi Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Issue template
about: Issue template
title: ''
labels: ''
assignees: ''

---

<!-- Please describe the issue in detail here, and fill in the fields below -->

### Reproducing code example:

<!-- A short code example that reproduces the problem/missing feature. It should be
self-contained, i.e., possible to run as-is via 'python myproblem.py' -->

```python
import gklearn
<< your code here >>
```

<!-- Remove these sections for a feature request -->

### Error message:

<!-- Full error message, if any (starting from line Traceback: ...) -->

### graphkit-learn/Python version information:

<!-- Output from 'import sys, gklearn; print(gklearn.__version__, sys.version)' -->
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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)
[![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.

Expand Down
16 changes: 4 additions & 12 deletions gklearn/kernels/treelet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions gklearn/kernels/treeletKernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down