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

Random walk with custom transition probabilities #88

Open
jinga-lala opened this issue Oct 31, 2020 · 6 comments
Open

Random walk with custom transition probabilities #88

jinga-lala opened this issue Oct 31, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@jinga-lala
Copy link

Is there any way to call random_walk function with custom transition probabilities?

@rusty1s
Copy link
Owner

rusty1s commented Oct 31, 2020

Currently no. I think one can implement it via alias sampling.

@jinga-lala
Copy link
Author

Are you referring to this function?

def random_walk(row: Tensor, col: Tensor, start: Tensor, walk_length: int,

If yes, I am sorry but I don't understand this function because it seems you are returning the same function again. If possible can you write the exact code snippet?
Any help would be appreciated.

@rusty1s
Copy link
Owner

rusty1s commented Nov 2, 2020

torch.ops.torch_cluster.random_walk calls the underlying CPU/CUDA implementation in csrc/cpu/rw_cpu.cpp and csrc/cuda/rw_cuda.cu. These implementations cannot currently handle custom transition probabilities.

@jinga-lala
Copy link
Author

Thanks for your reply.
Can you please write a wrapper over this function to handle transition probabilities, probably using alias sampling as you mentioned earlier?

@rusty1s
Copy link
Owner

rusty1s commented Nov 3, 2020

I see what I can do :)

@rusty1s rusty1s added the enhancement New feature or request label Nov 3, 2020
@ChainlessCoder
Copy link

This would be an extremely useful feature... As of now it's kinda tricky to do weighted random walks for e.g. node embeddings :/

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

No branches or pull requests

3 participants