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

Nodes with multiple attributes #118

Open
caspervanengelenburg opened this issue Nov 19, 2024 · 0 comments
Open

Nodes with multiple attributes #118

caspervanengelenburg opened this issue Nov 19, 2024 · 0 comments

Comments

@caspervanengelenburg
Copy link

Hey there,

I would like to use graph kernels for comparing graphs with multiple attributes. For instance, using GraphHopper or Propagation Kernels (not sure if WL kernels can do this.)

My graphs have both semantic labels (which can be seen as discrete) as well as continuous D-dim features. I would like to use the following node kernel:

$$ k_{\text{node}} \left( u, v\right) = \frac{ k_{\text{label}} \left( \ell_u, \ell_v \right) + k_{\text{feat}} \left( f_u, f_v \right) } {2}, $$

in which $k_{\text{label}}$ is simply checking whether the label is the same (1 for same; 0 for else) and $k_{\text{feat}}$ a similarity based on the two input arrays $f_u$ and $f_{v}$, e.g. euclidean similarity:

$$ \exp \left( - \left\Vert f_u - f_{v} \right\Vert \right). $$

I have set up my own (from scratch), but it is quite slow ... and I think this library can speed things up a bit. (In my case I use the p-th ordered rooted-walk graph kernels, similar as to: https://dl.acm.org/doi/10.1145/1964921.1964929, which is slightly different from the GraphHopper which using shortest path instead.)

Is there a way to set up a GraphHopper or Propagation Kernel that can handle these kind of node kernels? Is it possible in the first place in Grakel to work with such graphs (that have multiple node attributes)?

If you have any thoughts on this let me know.

Thanks,
Casper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant