Browse Source

Merge pull request #27 from jajupmochi/v0.2

V0.2
tags/v0.2.0
linlin GitHub 4 years ago
parent
commit
be4f169ae7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 17 deletions
  1. +17
    -17
      README.md
  2. +10
    -0
      gklearn/kernels/__init__.py
  3. +1
    -0
      gklearn/utils/__init__.py

+ 17
- 17
README.md View File

@@ -62,44 +62,44 @@ The docs of the library can be found [here](https://graphkit-learn.readthedocs.i


## Main contents ## Main contents


### List of graph kernels
### 1 List of graph kernels


* Based on walks * Based on walks
* The common walk kernel [1]
* [The common walk kernel](gklearn/kernels/common_walk.py) [1]
* Exponential * Exponential
* Geometric * Geometric
* [The marginalized kenrel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/marginalized.py)
* [The marginalized kenrel](gklearn/kernels/marginalized.py)
* With tottering [2] * With tottering [2]
* Without tottering [7] * Without tottering [7]
* The generalized random walk kernel [3]
* Sylvester equation
* [The generalized random walk kernel](gklearn/kernels/random_walk.py) [3]
* [Sylvester equation](gklearn/kernels/sylvester_equation.py)
* Conjugate gradient * Conjugate gradient
* Fixed-point iterations * Fixed-point iterations
* Spectral decomposition
* [Spectral decomposition](gklearn/kernels/spectral_decomposition.py)
* Based on paths * Based on paths
* [The shortest path kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/shortest_path.py) [4]
* [The structural shortest path kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/structural_sp.py) [5]
* [The path kernel up to length h](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/path_up_to_h.py) [6]
* [The shortest path kernel](gklearn/kernels/shortest_path.py) [4]
* [The structural shortest path kernel](gklearn/kernels/structural_sp.py) [5]
* [The path kernel up to length h](gklearn/kernels/path_up_to_h.py) [6]
* The Tanimoto kernel * The Tanimoto kernel
* The MinMax kernel * The MinMax kernel
* Non-linear kernels * Non-linear kernels
* [The treelet kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/treelet.py) [10]
* [Weisfeiler-Lehman kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/weisfeiler_lehman.py) [11]
* [Subtree](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/weisfeiler_lehman.py#L479)
* [The treelet kernel](gklearn/kernels/treelet.py) [10]
* [Weisfeiler-Lehman kernel](gklearn/kernels/weisfeiler_lehman.py) [11]
* [Subtree](gklearn/kernels/weisfeiler_lehman.py#L479)


A demo of computing graph kernels can be found on [Google Colab](https://colab.research.google.com/drive/17Q2QCl9CAtDweGF8LiWnWoN2laeJqT0u?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/compute_graph_kernel.py) folder. A demo of computing graph kernels can be found on [Google Colab](https://colab.research.google.com/drive/17Q2QCl9CAtDweGF8LiWnWoN2laeJqT0u?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/compute_graph_kernel.py) folder.


### Graph Edit Distances
### 2 Graph Edit Distances


### Graph preimage methods
### 3 Graph preimage methods


A demo of generating graph preimages can be found on [Google Colab](https://colab.research.google.com/drive/1PIDvHOcmiLEQ5Np3bgBDdu0kLOquOMQK?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/median_preimege_generator.py) folder. A demo of generating graph preimages can be found on [Google Colab](https://colab.research.google.com/drive/1PIDvHOcmiLEQ5Np3bgBDdu0kLOquOMQK?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/median_preimege_generator.py) folder.


### Interface to `GEDLIB`
### 4 Interface to `GEDLIB`


[`GEDLIB`](https://github.com/dbblumenthal/gedlib) is an easily extensible C++ library for (suboptimally) computing the graph edit distance between attributed graphs. [A Python interface](https://github.com/jajupmochi/graphkit-learn/tree/master/gklearn/gedlib) for `GEDLIB` is integrated in this library, based on [`gedlibpy`](https://github.com/Ryurin/gedlibpy) library.
[`GEDLIB`](https://github.com/dbblumenthal/gedlib) is an easily extensible C++ library for (suboptimally) computing the graph edit distance between attributed graphs. [A Python interface](gklearn/gedlib) for `GEDLIB` is integrated in this library, based on [`gedlibpy`](https://github.com/Ryurin/gedlibpy) library.


### Computation optimization methods
### 5 Computation optimization methods


* Python’s `multiprocessing.Pool` module is applied to perform **parallelization** on the computations of all kernels as well as the model selection. * Python’s `multiprocessing.Pool` module is applied to perform **parallelization** on the computations of all kernels as well as the model selection.
* **The Fast Computation of Shortest Path Kernel (FCSP) method** [8] is implemented in *the random walk kernel*, *the shortest path kernel*, as well as *the structural shortest path kernel* where FCSP is applied on both vertex and edge kernels. * **The Fast Computation of Shortest Path Kernel (FCSP) method** [8] is implemented in *the random walk kernel*, *the shortest path kernel*, as well as *the structural shortest path kernel* where FCSP is applied on both vertex and edge kernels.


+ 10
- 0
gklearn/kernels/__init__.py View File

@@ -18,3 +18,13 @@ from gklearn.kernels.structural_sp import StructuralSP
from gklearn.kernels.path_up_to_h import PathUpToH from gklearn.kernels.path_up_to_h import PathUpToH
from gklearn.kernels.treelet import Treelet from gklearn.kernels.treelet import Treelet
from gklearn.kernels.weisfeiler_lehman import WeisfeilerLehman, WLSubtree from gklearn.kernels.weisfeiler_lehman import WeisfeilerLehman, WLSubtree

# old version.
from gklearn.kernels.commonWalkKernel import commonwalkkernel
from gklearn.kernels.marginalizedKernel import marginalizedkernel
from gklearn.kernels.randomWalkKernel import randomwalkkernel
from gklearn.kernels.spKernel import spkernel
from gklearn.kernels.structuralspKernel import structuralspkernel
from gklearn.kernels.untilHPathKernel import untilhpathkernel
from gklearn.kernels.treeletKernel import treeletkernel
from gklearn.kernels.weisfeilerLehmanKernel import weisfeilerlehmankernel

+ 1
- 0
gklearn/utils/__init__.py View File

@@ -24,3 +24,4 @@ from gklearn.utils.utils import SpecialLabel, dummy_node, undefined_node, dummy_
from gklearn.utils.utils import normalize_gram_matrix, compute_distance_matrix from gklearn.utils.utils import normalize_gram_matrix, compute_distance_matrix
from gklearn.utils.trie import Trie from gklearn.utils.trie import Trie
from gklearn.utils.knn import knn_cv, knn_classification from gklearn.utils.knn import knn_cv, knn_classification
from gklearn.utils.model_selection_precomputed import model_selection_for_precomputed_kernel

Loading…
Cancel
Save