-
Notifications
You must be signed in to change notification settings - Fork 59
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
It seems like no implementation of metapath-based random walks. #2
Comments
I think it is easy to implement or modify existing random walk implementation. An easy (but not most efficient) way is to store node-type matrix whose size is (number of nodes) x (number of node types). It's a binary matrix. Then, every time you need to sample a specific node of a type, you can use a row as a binary mask to the corresponding row of the adjacent matrix. For example, let A adjacent matrix and let T as type matrix.
Assume that the random walker is at the node 10, and you need to sample an adjacent node whose type is 4. If you ignore about the node type requirement, you usually do Sample a non-zero index from the 10th row vector of A (say, A[10,:]). Right? Then when you need to limit to type 4, you use 4th row vector of T (say, T[4,:]). Then multiply to A[10,:] in a element wise manner. Then, Sample a non zero index from A[10,:]*T[4,:] . This will automatically meet the type requirements. Does this make sense? |
Thank you. I understand that. But should sample the A[10, :] * T[:4], right? The T is in shape (number of nodes) x (number of node types). The column of T does the mask, instead of the row. |
opps, yes you are right. Thank you for catching up the error!
…On Tue, Apr 3, 2018, 02:53 skx300 ***@***.***> wrote:
Thank you. I understand that. But should sample the A[10, :] * T[:4],
right? The T is in shape (number of nodes) x (number of node types). The
column of T does the mask, instead of the row.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH4D42LwbTKgmv9TbdUDX_jWIvIFlxcoks5tkxxngaJpZM4TEYrS>
.
|
It seems like no implementation of metapath-based random walks. Any help for finding it? or is it quit easy to implement it ?
The text was updated successfully, but these errors were encountered: