Giter VIP home page Giter VIP logo

Comments (2)

ysig avatar ysig commented on August 16, 2024

You should try a smaller lambda.
Theoretically geometric random walk converges if 1/lamda is bigger than the maximum eigenvalue of the kronecker product of the adjacency matrices of g1, g2. Only if the kernel converges it is psd. In another case the kernel value is not of a valid kernel and some other implementation set its value to zero.

A rule of thumb as noted by Viswanathan is setting lamda to the largest power of 10 which is smaller than 1/d^2, where d being the largest degree in the dataset.

B = [[0, 1, 1, 1, 1],
     [1, 0, 1, 1, 1],
     [1, 1, 0, 1, 1],
     [1, 1, 1, 0, 1],
     [1, 1, 1, 1, 0]]

rw_kernel_bl = RandomWalk(method_type="baseline", lamda=0.01)
rw_kernel_f = RandomWalk(lamda=0.01)

print(rw_kernel_bl.fit_transform([[B]])) # [[29.76190476]] -> [[1.0]] after normalization
print(rw_kernel_f.fit_transform([[B]])) # [[29.76190476]] -> [[1.0]] after normalization

Please install the latest grakel as I spotted an incosistency with the baseline.
Thanks a lot for taking our library into consideration 👍

from grakel.

dskoda avatar dskoda commented on August 16, 2024

Got it. New version installed and example working. The only difference to your example is that the result of print(rw_kernel_f.fit_transform([[B]])) is [[0.04761905]].

Thank you very much for your support and for the library!

from grakel.

Related Issues (20)

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.