GithubHelp home page GithubHelp logo

borgwardtlab / graphkernels Goto Github PK

View Code? Open in Web Editor NEW
100.0 10.0 55.0 44.75 MB

A package for computing Graph Kernels

License: MIT License

Python 4.57% C++ 88.27% C 5.58% SWIG 1.58%
graph-kernels graph-classification kernels graph-comparison python-package

graphkernels's Introduction

GraphKernels

A large collection of source code for computing kernels on graph. The src folder contains the following elements:

  • graphkernels is a Python package for graph kernels. The Python interface is created from a C++ source code that is wrapped with SWIG (http://www.swig.org)
  • GKextCPy is the package created to build the extension module for the wrapper from C++ to Python

graphkernels

graphkernels is a Python package for computing various graph kernels.

For the C++ implementation and R package, please refer to https://github.com/BorgwardtLab/graph-kernels.

The Python and R packages are described at:

  • M. Sugiyama, M.E. Ghisu, F. Llinares-López and K. Borgwardt. graphkernels: R and Python packages for graph comparison. Bioinformatics, 2017.

The paper can be found here

Installation

The users can installl the pakage via pip, by typing in a terminal

$ pip install graphkernels 

Alternatively, the package can be build from source. After downloading the source code from GitHub

$ git clone https://github.com/BorgwardtLab/GraphKernels.git

users can use the setup.py script to install the package

$ cd GraphKernels/src/graphkernels
$ python setup.py build
$ python setup.py install --user

In case of error in any of the above steps, please make sure that all requirements are satisfied. The install requirements section below provide instruction to install all the dependencies, in case you don't have them in your environment.

You should also make sure that you're installing the latest release of our package, in case you've had a previous version installed. To make sure the extension and package are not taken from your cache, you can use the --no-cache-dir option and install the package as:

$ pip --no-cache-dir install graphkernels

Installing the requirements

Note that graphkernels is a Python library relying on C++ source code. The wrapper is built upon an extension which need to be installed in order for the package to work (automatically handled). If you experience problems with the installation above, you might be missing one or more of the dependencies tools, which need to be pre-installed in your environment.

We recommend the following steps for installing the dependencies

  1. Install eigen3

    On Ubuntu:

    $ sudo apt-get install libeigen3-dev

    On MacOSX:

    $ brew install eigen

  2. Install pkg-config

    On Ubuntu:

    $ sudo apt-get install pkg-config

    On MacOSX

    $ brew install pkg-config

Additional Python dependencies are automatically handled when installing the graphkernels package:

  • GKextCPy
  • igraph
  • numpy

Usage

We provide a short tutorial for the basic usage of our package; there, you can also find an example script for computing graph kernels through our package on a benchmark dataset.

Citation

If you use the graphkernels package in your projects please cite our work

@article{Sugiyama-2017-Bioinformatics,
author = {Sugiyama, Mahito and Ghisu, M. Elisabetta and Llinares-López, Felipe and Borgwardt, Karsten},
title = {graphkernels: R and Python packages for graph comparison},
journal = {Bioinformatics},
volume = {34},
number = {3},
pages = {530--532},
year = {2017},
doi = {10.1093/bioinformatics/btx602},
URL = {http://dx.doi.org/10.1093/bioinformatics/btx602},
}

Acknowledgements

The development of the graphkernels open access software package was financially supported by the Horizon 2020/CDS-QUAMRI/634541 project. This support is gratefully acknowledged.

graphkernels's People

Contributors

antoineprv avatar bkj avatar eghisu avatar mahito-sugiyama avatar pseudomanifold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphkernels's Issues

kernels do not take vertex atributes into account

In the readme there is no mention whether the kernels look at the attributes. But in the code if you give an edge more than one attribute it gives a warning that it only takes the first into account. this behavior is not present with vertices.

I wrote a script to test the different kernels, it however seems that the kernels do not take vertex attributes into account. the output of the script is below with the name of the kernel followed by the gram matrix. on the bottom are the igraph attributes of the graphs.

Are the attributes not taken into account or am i missing something? This would otherwise be good to mention in the readme.

output below:

`CalculateEdgeHistKernel
[[ 36. 36. 36. 36.]
[ 36. 36. 36. 36.]
[ 36. 36. 36. 36.]
[ 36. 36. 36. 36.]]
CalculateVertexHistKernel
[[ 4. 4. 4. 4.]
[ 4. 4. 4. 4.]
[ 4. 4. 4. 4.]
[ 4. 4. 4. 4.]]
CalculateVertexEdgeHistKernel
[[ 6. 6. 6. 6.]
[ 6. 6. 6. 6.]
[ 6. 6. 6. 6.]
[ 6. 6. 6. 6.]]
CalculateVertexVertexEdgeHistKernel
[[ 10. 10. 10. 10.]
[ 10. 10. 10. 10.]
[ 10. 10. 10. 10.]
[ 10. 10. 10. 10.]]
CalculateEdgeHistGaussKernel
[[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]]
CalculateVertexHistGaussKernel
[[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]]
CalculateVertexEdgeHistGaussKernel
[[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]
[ 1. 1. 1. 1.]]
CalculateGeometricRandomWalkKernel
[[ 9.27679537e+48 9.27679537e+48 9.27679537e+48 9.27679537e+48]
[ 9.27679537e+48 9.27679537e+48 9.27679537e+48 9.27679537e+48]
[ 9.27679537e+48 9.27679537e+48 9.27679537e+48 9.27679537e+48]
[ 9.27679537e+48 9.27679537e+48 9.27679537e+48 9.27679537e+48]]
CalculateExponentialRandomWalkKernel
[[ 80.34214769 290.68846622 290.68846622 290.68846622]
[ 290.68846622 290.68846622 290.68846622 290.68846622]
[ 290.68846622 290.68846622 290.68846622 290.68846622]
[ 290.68846622 290.68846622 290.68846622 290.68846622]]
CalculateKStepRandomWalkKernel
[[ 4. 4. 4. 4.]
[ 4. 4. 4. 4.]
[ 4. 4. 4. 4.]
[ 4. 4. 4. 4.]]
CalculateWLKernel
[[ 84. 84. 84. 84.]
[ 84. 84. 84. 84.]
[ 84. 84. 84. 84.]
[ 84. 84. 84. 84.]]
CalculateShortestPathKernel
[[ 48. 48. 48. 48.]
[ 48. 48. 48. 48.]
[ 48. 48. 48. 48.]
[ 48. 48. 48. 48.]]

igraph.Vertex(<igraph.Graph object at 0x7f4826c2f7c8>, 0, {'id': 0.0, 'label': 0.0, 'AA': 'A', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f7c8>, 1, {'id': 1.0, 'label': 1.0, 'AA': 'B', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f7c8>, 2, {'id': 2.0, 'label': 2.0, 'AA': 'C', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f7c8>, 3, {'id': 3.0, 'label': 3.0, 'AA': 'D', 'test': 'alpha'})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f7c8>, 0, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f7c8>, 1, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f7c8>, 2, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f7c8>, 3, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f7c8>, 4, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f7c8>, 5, {'distance': 1.0})

igraph.Vertex(<igraph.Graph object at 0x7f4826c2f8b8>, 0, {'id': 0.0, 'label': 0.0, 'AA': 'A', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f8b8>, 1, {'id': 1.0, 'label': 1.0, 'AA': 'B', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f8b8>, 2, {'id': 2.0, 'label': 2.0, 'AA': 'C', 'test': 'beta'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f8b8>, 3, {'id': 3.0, 'label': 3.0, 'AA': 'D', 'test': 'beta'})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f8b8>, 0, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f8b8>, 1, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f8b8>, 2, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f8b8>, 3, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f8b8>, 4, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f8b8>, 5, {'distance': 1.0})

igraph.Vertex(<igraph.Graph object at 0x7f4826c2f9a8>, 0, {'id': 0.0, 'label': 0.0, 'AA': 'A', 'test': 'beta'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f9a8>, 1, {'id': 1.0, 'label': 1.0, 'AA': 'B', 'test': 'beta'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f9a8>, 2, {'id': 2.0, 'label': 2.0, 'AA': 'C', 'test': 'beta'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2f9a8>, 3, {'id': 3.0, 'label': 3.0, 'AA': 'D', 'test': 'beta'})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f9a8>, 0, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f9a8>, 1, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f9a8>, 2, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f9a8>, 3, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f9a8>, 4, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2f9a8>, 5, {'distance': 1.0})

igraph.Vertex(<igraph.Graph object at 0x7f4826c2fa98>, 0, {'id': 0.0, 'label': 0.0, 'AA': 'A', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2fa98>, 1, {'id': 1.0, 'label': 1.0, 'AA': 'B', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2fa98>, 2, {'id': 2.0, 'label': 2.0, 'AA': 'C', 'test': 'alpha'})
igraph.Vertex(<igraph.Graph object at 0x7f4826c2fa98>, 3, {'id': 3.0, 'label': 3.0, 'AA': 'D', 'test': 'beta'})
igraph.Edge(<igraph.Graph object at 0x7f4826c2fa98>, 0, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2fa98>, 1, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2fa98>, 2, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2fa98>, 3, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2fa98>, 4, {'distance': 1.0})
igraph.Edge(<igraph.Graph object at 0x7f4826c2fa98>, 5, {'distance': 1.0})
---'

Graph format error (invalid literal for int())

Would you have a detailed specification of what kinds of graphs and graph attributes are accepted by this package?

For example, I am getting an exception:

Traceback (most recent call last):
  File "demo.py", line 32, in <module>
    K7 = gk.CalculateVertexEdgeHistGaussKernel(mutag_list)
  File "/Users/carlosgonzalezoliver/anaconda/envs/py36/lib/python3.6/site-packages/graphkernels/kernels.py", line 107, in CalculateVertexEdgeHistGaussKernel
    E, V_label, V_count, E_count, D_max = GetGKInput(G)
  File "/Users/carlosgonzalezoliver/Projects/GraphKernels_carlos/utilities.py", line 73, in GetGKInput
    E.append(g_info['edge'])
  File "/Users/carlosgonzalezoliver/anaconda/envs/py36/lib/python3.6/site-packages/GKextCPy.py", line 771, in append
    return _GKextCPy.VecMatrixXi_append(self, x)
ValueError: invalid literal for int() with base 10: '0.0'

On graphs with the following iGraph format:

IGRAPH U--- 12 16 --
+ attr: id (v), label (v), interaction (e)
+ edges:
 0 --  1             3 --  1  2  4  5    6 --  5  8  9       9 --  6  7 10
 1 --  0  2  3       4 --  2  3  5       7 --  5  9         10 --  8  9
 2 --  1  3  4       5 --  3  4  6  7    8 --  6 10 11      11 --  8

Where id is an integer, label is a string, and interaction is also a string.

To the best of my knowledge this is the same format as the one provided in the MUTAG demo but maybe I'm missing something.

Thanks!

igraph installation error

Hello,

Having already successfully installed igraph (and python-igraph)

pip freeze | grep "igraph" 
igraph==0.1.11
python-igraph==0.7.1.post6

I am trying to install the requirement gkextcpy using pip

pip install gkextcpy

However, I get the following error

 gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/carlosgonzalezoliver/anaconda/envs/py36/include -arch x86_64 -I/Users/carlosgonzalezoliver/anaconda/envs/py36/include -arch x86_64 -I/Users/carlosgonzalezoliver/anaconda/envs/py36/include/python3.6m -c GKextCPy_wrap.cxx -o build/temp.macosx-10.7-x86_64-3.6/GKextCPy_wrap.o -std=c++11
    In file included from GKextCPy_wrap.cxx:3143:
    ./GKextCPy.h:16:10: fatal error: 'igraph/igraph.h' file not found
    #include <igraph/igraph.h>
             ^~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1

Am I missing any step for configuring igraph?

Thanks!

CalculateVertexHistKernel(): NameError: name 'gs' is not defined

Hello,

I've created a list of directed igraphs with several attributes for each vertex. Applying the CalculateVertexHistKernel - function, I receive the following error:

Traceback (most recent call last):
K = gk.CalculateVertexHistKernel(data1)
File "/usr/local/lib/python3.7/site-packages/graphkernels/kernels.py", line 42, in CalculateVertexHistKernel
E, V_label, V_count, E_count, D_max = GetGKInput(G)
File "/usr/local/lib/python3.7/site-packages/graphkernels/utilities.py", line 79, in GetGKInput
g_info = GetGraphInfo(G[i])
File "/usr/local/lib/python3.7/site-packages/graphkernels/utilities.py", line 51, in GetGraphInfo
v_attr_name = gs.vs.attributes()[0]
NameError: name 'gs' is not defined

Thanks in advance.

Issue with Vertex Attributes

I have only one attribute for the vertex (the id attribute).
The file utilities.py gives me index out of bounds exception.

Do we need to relax the condition astype(int) or change if len(g.vs.attributes()) == 0 to <=1 to bypass this?

Thanks.

missing graphkernels.py

The python module is missing the source file for graphkernels/graphkernels.pyc.

I would recommend distributing only .py files, not .pyc files, so that people can contribute improvements, such as porting the module to Python 3 (the file is byte-compiled for Python 2, and triggers a magic number error under Python 3 that is unfixable without the .py file).

Gram matrix for prediction

Hello,

I am trying to use this tool to make predictions with an SVM. I am able to get an n x n Gram matrix on the training data for n training examples. However, when I want to make predictions I need the Gram matrix between input vectors and the support vectors so I would need a Gram matrix in the form m x n for m training examples. However, the provided Gram matrix functions always take a 1D list and perform an all-vs-all comparison to yield the Gram matrix. I was wondering if there is any setting that will allow me to get a Gram matrix for predictions. Thanks!

Missing `eigen3` library. Please install it using the package manager of your operating system

Hello,
I am using windows,
I downloaded eigen following the windows method suggested in here
I also tried to download eigen using conda in here
In both cases, I get the message that Eigen is downloaded properly. But when I try to install graphkernls using "$ pip install graphkernels " or doing "python setup.py install --user", I get the following error:
Missing eigen3 library. Please install it using the package manager of your operating system

any help?

graphkernel installation: GKextCPy fatal error, no such file

Hey,

I'm using MacOS High Sierra, python 3.6, GCC Version 4.8.5. Running pip install graphkernels I get the following error:


running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying GKextCPy.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_GKextCPy' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/local/Cellar/eigen/3.3.5/include/eigen3 -I/anaconda3/include/python3.6m -c GKextCPy_wrap.cxx -o build/temp.macosx-10.7-x86_64-3.6/GKextCPy_wrap.o -std=c++11 -O3
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from GKextCPy_wrap.cxx:3143:0:
GKextCPy.h:16:29: fatal error: eigen3/Eigen/Core: No such file or directory
#include <eigen3/Eigen/Core>
^
compilation terminated.
error: command 'gcc' failed with exit status 1

Failed building wheel for GKextCPy
Running setup.py clean for GKextCPy
Failed to build GKextCPy
Installing collected packages: GKextCPy
Running setup.py install for GKextCPy ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/z4/lq2f76c5737d7x7vr4jcx4gr0000gn/T/pip-install-8p1m2e6a/GKextCPy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/z4/lq2f76c5737d7x7vr4jcx4gr0000gn/T/pip-record-i0531eqk/install-record.txt --single-version-externally-managed --compile:
Requirement already satisfied: numpy in /anaconda3/lib/python3.6/site-packages (1.13.3)
Requirement already satisfied: pkgconfig in /Users/matthiasbinder/.local/lib/python3.6/site-packages (1.4.0)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying GKextCPy.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_GKextCPy' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/local/Cellar/eigen/3.3.5/include/eigen3 -I/anaconda3/include/python3.6m -c GKextCPy_wrap.cxx -o build/temp.macosx-10.7-x86_64-3.6/GKextCPy_wrap.o -std=c++11 -O3
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from GKextCPy_wrap.cxx:3143:0:
GKextCPy.h:16:29: fatal error: eigen3/Eigen/Core: No such file or directory
#include <eigen3/Eigen/Core>
^
compilation terminated.
error: command 'gcc' failed with exit status 1


The Issue seems to be here: GKextCPy.h:16:29: fatal error: eigen3/Eigen/Core: No such file or directory

Would be awesome if anyone could help!

Thank you.

How to get the explicit feature map?

Hello,

I am able to install the software get the kernel. But for some graph kernel, say, WL kernel, there is explicit feature map, how to get that?

graphkernels can not find `igraph.h`

Hey there,
I'd like to try out your package but I have troubles with the installation.
I installed igraph via pip install python-igraph and it ran through without any error.

However, when I subsequently try to install graphkernels via pip install graphkernels I get the following error:

In file included from GKextCPy_wrap.cxx:3143:0:
  GKextCPy.h:16:27: fatal error: igraph/igraph.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

It seems it can not find igraph.
I assume it has to do with the troubles of installing igraph with the appropriate c kernel but I thought maybe one of you knows how to fix this issue.

Update:
I can find the igraph.h in
/usr/local/lib/python3.5/dist-packages/python-igraph/igraphcore/include. Is there a way to point the setup.py to it?

Update2:
I also ran

import igraph.test 
igraph.test.run_tests()

in a Python3 console. The tests ran through okay. So I guess, the installation of igraph worked indeed.

Windows build_ext giving error

Hi,

I am trying to use the graph kernels package in Windows 10. I am having trouble building the extension module.
Here is the command that is giving me error.

python setup.py build_ext
running build_ext
building '_GKextCPy' extension
AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I\anaconda2\include -I\anaconda2\PC /TpGKextCPy_wrap.cxx /Fobuild\temp.win-amd64-2.7\Release\GKextCPy_wrap.obj -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
GKextCPy_wrap.cxx
\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
\graphkernels\graphkernels-master\gkextcpy\GKextCPy.h(22) : fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
error: command '\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

Please help. Thanks.

GKextCPy compilation error on installation

Hello!

When i try to install this package using either pip or cloning repository, following, quite verbose, errors happen on GKextCPy compilation step:

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
                 from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from GKextCPy_wrap.cxx:3665:
/usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
GKextCPy_wrap.cxx: In instantiation of ‘PyObject* ConvertFromEigenToNumpyMatrix(Eigen::MatrixBase<Derived>*, void*, bool) [with Derived = Eigen::Matrix<int, -1, -1>; PyObject = _object]’:
GKextCPy_wrap.cxx:17355:75:   required from here
GKextCPy_wrap.cxx:6084:39: warning: unused variable ‘cpp_data’ [-Wunused-variable]
             typename Derived::Scalar* cpp_data= static_cast<typename Derived::Scalar*>(data);
                                       ^
GKextCPy_wrap.cxx: In instantiation of ‘void ConvertFromNumpyToEigenMatrix(Eigen::MatrixBase<Derived>*, PyObject*) [with Derived = Eigen::Matrix<int, -1, -1>; PyObject = _object]’:
GKextCPy_wrap.cxx:17446:47:   required from here
GKextCPy_wrap.cxx:6157:14: warning: unused variable ‘numpy_is_row_major’ [-Wunused-variable]
         bool numpy_is_row_major = array_is_contiguous(in);
              ^
GKextCPy_wrap.cxx:6159:13: warning: unused variable ‘numpy_type_code’ [-Wunused-variable]
         int numpy_type_code = array_type(in);
             ^
GKextCPy_wrap.cxx: In instantiation of ‘PyObject* ConvertFromEigenToNumpyMatrix(Eigen::MatrixBase<Derived>*, void*, bool) [with Derived = Eigen::Matrix<double, -1, -1>; PyObject = _object]’:
GKextCPy_wrap.cxx:18783:85:   required from here
GKextCPy_wrap.cxx:6084:39: warning: unused variable ‘cpp_data’ [-Wunused-variable]
             typename Derived::Scalar* cpp_data= static_cast<typename Derived::Scalar*>(data);
                                       ^
GKextCPy_wrap.cxx: In instantiation of ‘void ConvertFromNumpyToEigenMatrix(Eigen::MatrixBase<Derived>*, PyObject*) [with Derived = Eigen::Matrix<double, -1, 1>; PyObject = _object]’:
GKextCPy_wrap.cxx:19689:47:   required from here
GKextCPy_wrap.cxx:6157:14: warning: unused variable ‘numpy_is_row_major’ [-Wunused-variable]
         bool numpy_is_row_major = array_is_contiguous(in);
              ^
GKextCPy_wrap.cxx:6159:13: warning: unused variable ‘numpy_type_code’ [-Wunused-variable]
         int numpy_type_code = array_type(in);
             ^
GKextCPy_wrap.cxx: In instantiation of ‘PyObject* ConvertFromEigenToNumpyMatrix(Eigen::MatrixBase<Derived>*, void*, bool) [with Derived = Eigen::Matrix<double, -1, 1>; PyObject = _object]’:
GKextCPy_wrap.cxx:19695:85:   required from here
GKextCPy_wrap.cxx:6084:39: warning: unused variable ‘cpp_data’ [-Wunused-variable]
             typename Derived::Scalar* cpp_data= static_cast<typename Derived::Scalar*>(data);
                                       ^
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h: In instantiation of ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’:
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: error: no matching function for call to ‘Eigen::Matrix<int, -1, -1>::_init1(const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >&)’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:740:30: note: candidate: template<class T> void Eigen::PlainObjectBase<Derived>::_init1(Eigen::Index, typename Eigen::internal::enable_if<(((typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != 1) || (! Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value)) && ((! Eigen::internal::is_same<typename Eigen::internal::traits<T>::XprKind, Eigen::ArrayXpr>::value) || (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime == Eigen::Dynamic))), T>::type*) [with T = T; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(Index size, typename internal::enable_if<    (Base::SizeAtCompileTime!=1 || !internal::is_convertible<T, Scalar>::value)
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:740:30: note:   template argument deduction/substitution failed:
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: note:   cannot convert ‘x’ (type ‘const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >’) to type ‘Eigen::Index {aka long int}’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:753:30: note: candidate: template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Scalar&, typename Eigen::internal::enable_if<((typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime == 1) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value), T>::type*) [with T = T; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const Scalar& val0, typename internal::enable_if<Base::SizeAtCompileTime==1 && internal::is_convertible<T, Scalar>::value,T>::type* = 0)
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:753:30: note:   template argument deduction/substitution failed:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h: In substitution of ‘template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Scalar&, typename Eigen::internal::enable_if<((typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime == 1) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value), T>::type*) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >]’:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:753:30: error: invalid use of incomplete type ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> > >’
In file included from /usr/include/eigen3/Eigen/Core:295:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/util/Meta.h:131:45: note: declaration of ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> > >’
 template<bool Condition, typename T> struct enable_if;
                                             ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h: In instantiation of ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’:
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:762:30: note: candidate: template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Index&, typename Eigen::internal::enable_if<((((! Eigen::internal::is_same<long int, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<long int, T>::value) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime == 1)) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value), T*>::type*) [with T = T; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const Index& val0,
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:762:30: note:   template argument deduction/substitution failed:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h: In substitution of ‘template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Index&, typename Eigen::internal::enable_if<((((! Eigen::internal::is_same<long int, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<long int, T>::value) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime == 1)) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value), T*>::type*) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >]’:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:762:30: error: invalid use of incomplete type ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >*>’
In file included from /usr/include/eigen3/Eigen/Core:295:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/util/Meta.h:131:45: note: declaration of ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >*>’
 template<bool Condition, typename T> struct enable_if;
                                             ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h: In instantiation of ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’:
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:775:30: note: candidate: template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Scalar*) [with T = T; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const Scalar* data){
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:775:30: note:   template argument deduction/substitution failed:
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: note:   cannot convert ‘x’ (type ‘const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >’) to type ‘const Scalar* {aka const int*}’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:782:30: note: candidate: template<class T, class OtherDerived> void Eigen::PlainObjectBase<Derived>::_init1(const Eigen::DenseBase<ElseDerived>&) [with T = T; OtherDerived = OtherDerived; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const DenseBase<OtherDerived>& other){
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:782:30: note:   template argument deduction/substitution failed:
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: note:   ‘const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >’ is not derived from ‘const Eigen::DenseBase<Derived>’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:789:30: note: candidate: template<class T, class OtherDerived> void Eigen::PlainObjectBase<Derived>::_init1(const Eigen::EigenBase<OtherDerived>&) [with T = T; OtherDerived = OtherDerived; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const EigenBase<OtherDerived>& other){
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:789:30: note:   template argument deduction/substitution failed:
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: note:   ‘const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >’ is not derived from ‘const Eigen::EigenBase<OtherDerived>’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:795:30: note: candidate: template<class T, class OtherDerived> void Eigen::PlainObjectBase<Derived>::_init1(const Eigen::ReturnByValue<OtherDerived>&) [with T = T; OtherDerived = OtherDerived; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const ReturnByValue<OtherDerived>& other)
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:795:30: note:   template argument deduction/substitution failed:
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: note:   ‘const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >’ is not derived from ‘const Eigen::ReturnByValue<OtherDerived>’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:803:30: note: candidate: template<class T, class OtherDerived, int ColsAtCompileTime> void Eigen::PlainObjectBase<Derived>::_init1(const Eigen::RotationBase<OtherDerived, ColsAtCompileTime>&) [with T = T; OtherDerived = OtherDerived; int ColsAtCompileTime = ColsAtCompileTime; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const RotationBase<OtherDerived,ColsAtCompileTime>& r)
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:803:30: note:   template argument deduction/substitution failed:
In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: note:   ‘const swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >’ is not derived from ‘const Eigen::RotationBase<OtherDerived, ColsAtCompileTime>’
       Base::template _init1<T>(x);
                               ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:811:30: note: candidate: template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Scalar&, typename Eigen::internal::enable_if<((((typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != Eigen::Dynamic) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != 1)) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<typename Eigen::internal::traits<T>::XprKind, Eigen::ArrayXpr>::value), T>::type*) [with T = T; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const Scalar& val0,
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:811:30: note:   template argument deduction/substitution failed:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h: In substitution of ‘template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Scalar&, typename Eigen::internal::enable_if<((((typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != Eigen::Dynamic) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != 1)) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<typename Eigen::internal::traits<T>::XprKind, Eigen::ArrayXpr>::value), T>::type*) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >]’:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:811:30: error: invalid use of incomplete type ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> > >’
In file included from /usr/include/eigen3/Eigen/Core:295:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/util/Meta.h:131:45: note: declaration of ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> > >’
 template<bool Condition, typename T> struct enable_if;
                                             ^
In file included from /usr/include/eigen3/Eigen/Core:366:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/Matrix.h: In instantiation of ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’:
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:822:30: note: candidate: template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Index&, typename Eigen::internal::enable_if<((((((! Eigen::internal::is_same<long int, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<long int, T>::value) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != Eigen::Dynamic)) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != 1)) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<typename Eigen::internal::traits<T>::XprKind, Eigen::ArrayXpr>::value), T*>::type*) [with T = T; Derived = Eigen::Matrix<int, -1, -1>]
     EIGEN_STRONG_INLINE void _init1(const Index& val0,
                              ^
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:822:30: note:   template argument deduction/substitution failed:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h: In substitution of ‘template<class T> void Eigen::PlainObjectBase<Derived>::_init1(const Index&, typename Eigen::internal::enable_if<((((((! Eigen::internal::is_same<long int, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<long int, T>::value) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != Eigen::Dynamic)) && (typename Eigen::internal::dense_xpr_base<Derived>::type:: SizeAtCompileTime != 1)) && Eigen::internal::is_convertible<T, typename Eigen::internal::traits<T>::Scalar>::value) && Eigen::internal::is_same<typename Eigen::internal::traits<T>::XprKind, Eigen::ArrayXpr>::value), T*>::type*) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >]’:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >; _Scalar = int; int _Rows = -1; int _Cols = -1; int _Options = 0; int _MaxRows = -1; int _MaxCols = -1]’
GKextCPy_wrap.cxx:4755:7:   required from ‘void swig::assign(const SwigPySeq&, Seq*) [with SwigPySeq = swig::SwigPySequence_Cont<Eigen::Matrix<int, -1, -1> >; Seq = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4777:12:   required from ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, swig::traits_asptr_stdseq<Seq, T>::sequence**) [with Seq = std::vector<Eigen::Matrix<int, -1, -1> >; T = Eigen::Matrix<int, -1, -1>; PyObject = _object; swig::traits_asptr_stdseq<Seq, T>::sequence = std::vector<Eigen::Matrix<int, -1, -1> >]’
GKextCPy_wrap.cxx:4838:52:   required from ‘static int swig::traits_asptr<std::vector<_RealType> >::asptr(PyObject*, std::vector<_RealType>**) [with T = Eigen::Matrix<int, -1, -1>; PyObject = _object]’
GKextCPy_wrap.cxx:3816:37:   required from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<Eigen::Matrix<int, -1, -1> >; PyObject = _object]’
GKextCPy_wrap.cxx:16925:34:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:822:30: error: invalid use of incomplete type ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >*>’
In file included from /usr/include/eigen3/Eigen/Core:295:0,
                 from GKextCPy.h:16,
                 from GKextCPy_wrap.cxx:3143:
/usr/include/eigen3/Eigen/src/Core/util/Meta.h:131:45: note: declaration of ‘struct Eigen::internal::enable_if<false, swig::SwigPySequence_Ref<Eigen::Matrix<int, -1, -1> >*>’
 template<bool Condition, typename T> struct enable_if;
                                             ^
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I`ve tried both pyton2 and python3, error is the same. Eigen3 is 3.3~beta1-2 version , pkg-config is 0.29.1, numpy is 1.15.0.

System info: Linux 4.13.0-36-generic #40~16.04.1-Ubuntu

Any help is appreciated.

W

when i set up the python package named GKextCPy-0.3.0 you offered ,there are a lot of questions .
it shows the following"

  1. fatal error:numpy/arrayobject.h:No such file or directory.

Error installing graphkernels/GKextCPy: Unable to locate python.h header file.

Hello!

I want to install graphkernels, and am receiving the output at the following file when using the command: pip --no-cache-dir install graphkernels:
graphkernels_install_err.txt

The main error from this seems to be "Python.h: No such file or directory". My understanding is that this usually means that pythonX.Y-dev must be installed according to the python version used.

I have confirmed that I do have python3.9-dev installed corresponding to my version of python using the command sudo apt-get install python3.9-dev, which gave the output "python3.9-dev is already the newest version (3.9.13-1+jammy1)." And the Python.h file exists on my system at /usr/include/python3.9/Python.h.

Is there something else I should do to install the package?

Randomized result for WL graph kernel

It seems that WL_kernel is a randomized algorithm. Would you like to point out the source of randomness in the original paper(http://www.jmlr.org/papers/volume12/shervashidze11a/shervashidze11a.pdf)?

I tried on WL_kernel on sample data(data.mutag). I print the min and max element in the kernel matrix, and the range is usually around 50-2000, but sometimes the algorithm will give the wrong answer such as the following:
The shape of K_wl is (188, 188)
Min: -1771.8888747654491, Max 1.1436141205647204e+292

Any idea why?

GKextCPy compilation error

Hi!
I'm using win10, x64, python3.5.
running pip install graphkernels I get the following error. Every requirement is installed. I know there should be no sys.time.h on windows at all, which the compiler looks for.
Thank you.

 ----------------------------------------
  Failed building wheel for GKextCPy
  Running setup.py clean for GKextCPy
Failed to build GKextCPy
Installing collected packages: GKextCPy
  Running setup.py install for GKextCPy: started
    Running setup.py install for GKextCPy: finished with status 'error'
    Complete output from command c:\winpython\python-3.5.4.amd64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\elekes\\AppData\\Local\\Temp\\pip-install-l5v9t3p7\\GKextCPy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\elekes\AppData\Local\Temp\pip-record-dx5qo3k4\install-record.txt --single-version-externally-managed --compile:
    Requirement already satisfied: numpy in c:\winpython\python-3.5.4.amd64\lib\site-packages (1.13.3+mkl)
    Requirement already satisfied: pkgconfig in c:\winpython\python-3.5.4.amd64\lib\site-packages (1.3.1)
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.5
    copying GKextCPy.py -> build\lib.win-amd64-3.5
    running build_ext
    building '_GKextCPy' extension
    creating build\temp.win-amd64-3.5
    creating build\temp.win-amd64-3.5\Release
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\winpython\python-3.5.4.amd64\lib\site-packages\numpy\core\include -I -Ic:\winpython\python-3.5.4.amd64\include -Ic:\winpython\python-3.5.4.amd64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" /EHsc /TpGKextCPy_wrap.cxx /Fobuild\temp.win-amd64-3.5\Release\GKextCPy_wrap.obj -std=c++11 -O3
    cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
    cl : Command line warning D9002 : ignoring unknown option '-O3'
    GKextCPy_wrap.cxx
    c:\users\elekes\appdata\local\temp\pip-install-l5v9t3p7\gkextcpy\GKextCPy.h(21): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

Small typo ?

I am playing around with the package and I encountered a small bug that might just be a typo in utilities.py line 51:
v_attr_name = gs.vs.attributes()[0]
Shouldn't this be:
v_attr_name = g.vs.attributes()[0]
Here is a small code that reproduces the bug:
import igraph
import graphkernels.kernels as gk
g = igraph.Graph.GRG(100, 0.2)
gk.CalculateEdgeHistKernel([g])

Tutorial can not be reproduced in python3

Hey there,

I've installed all the libraries and dependencies necessary and build the graphkernels package from source.
So far I've been able to reproduce the mutag_pydata.py script in a python3 console.
However, when I try to reproduce the code of demo_mutag.py I get an error in the calculation of the first Kernel:
'K1 = gk.CalculateEdgeHistKernel(mutag_list)'

it throws:

Traceback (most recent call last):                                                                                                        
  File "<stdin>", line 1, in <module>                                                                                                     
  File "/usr/local/lib/python3.5/dist-packages/graphkernels-0.1.8-py3.5.egg/graphkernels/kernels.py", line 25, in CalculateEdgeHistKernel 
  File "/usr/local/lib/python3.5/dist-packages/graphkernels-0.1.8-py3.5.egg/graphkernels/utilities.py", line 63, in GetGKInput            
  File "/usr/local/lib/python3.5/dist-packages/graphkernels-0.1.8-py3.5.egg/graphkernels/utilities.py", line 40, in GetGraphInfo          
ValueError: invalid literal for int() with base 10: 'n0' 

When I create an own mutag_pydata.npy data object it works again.
I guess it is a compatibility issue between python 2.7 and python 3. However, I though you might want to be made aware of this

Eigen3 dependency issue

Hi,

Where does graphkernels require eigen to be installed at. I haven't installed Eigen at /usr/local/(default, I believe) because of a lack of sudo privileges. But rather installed it to my favourite location and added it to my $PATH. I get the following error when I pip install or setup.py install it.

I get the following error.

Traceback (most recent call last):
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-v7o9ddts/GKextCPy-0.4.1/setup.py", line 41, in
File "/tmp/easy_install-v7o9ddts/GKextCPy-0.4.1/setup.py", line 27, in get_include_dirs
Exception: Missing eigen3 library. Please install it using the package manager of your operating system

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 13, in
package_data={'graphkernels': ['data.mutag']},
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/init.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/home/shivava1/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/shivava1/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/shivava1/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 412, in run
self.easy_install(spec, not self.no_deps)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 654, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 701, in install_item
self.process_distribution(spec, dist, deps)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 746, in process_distribution
[requirement], self.local_index, self.easy_install
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 881, in resolve
replace_conflicting=replace_conflicting
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 1164, in best_match
return self.obtain(req, installer)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 1176, in obtain
return installer(requirement)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 699, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1138, in run_setup
run_setup(setup_script, args)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/home/shivava1/anaconda3/lib/python3.6/contextlib.py", line 99, in exit
self.gen.throw(type, value, traceback)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/shivava1/anaconda3/lib/python3.6/contextlib.py", line 99, in exit
self.gen.throw(type, value, traceback)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/shivava1/anaconda3/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-v7o9ddts/GKextCPy-0.4.1/setup.py", line 41, in
File "/tmp/easy_install-v7o9ddts/GKextCPy-0.4.1/setup.py", line 27, in get_include_dirs
Exception: Missing eigen3 library. Please install it using the package manager of your operating system

Please advice

Add a parameter for normalizing the output value?

Looks like current graph kernel calculation outputs are not normalized. Is there any plan to add support for this?

Also, providing different Par values to kernel function will generate in different kernel matrix. Is there any way to generate a deterministic output?

Kernel distance is negative

Hello,
I am trying to calculate kernel distance d(i, j)^2 = k(i,i) + k(j,j) - 2 * k(i,j) and embed the data for visualization. However, I found that some times k(i, i) is smaller than k(i,j) for some j !=i, yielding the negative kernel distance.

For example, I tried WL_kernel on mutag dataset and got this

mutag_list = np.load('/home/cai.507/Documents/DeepLearning/GraphKernels/graphkernels/graphkernels/data.mutag')
K = gk.CalculateWLKernel(mutag_list, par = 3)
i = 154; j = 156

K[i,i] + K[j,j] -2 * K[i,j] = -2208.2109375
K[i,i] = 245.0234375
K[j,j] = 1011.578125
K[j,j] = 1011.578125
Am I missing something here, Such as normalization of kernel?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.