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

Metapath random walk not considering edge type? #101

Closed
Wang-Yu-Qing opened this issue Apr 16, 2021 · 2 comments
Closed

Metapath random walk not considering edge type? #101

Wang-Yu-Qing opened this issue Apr 16, 2021 · 2 comments

Comments

@Wang-Yu-Qing
Copy link

In the walk function:

def walk(args):
    walk_length, start, schema = args
    # Simulate a random walk starting from start node.
    rand = random.Random()

    if schema:
        schema_items = schema.split('-')
        assert schema_items[0] == schema_items[-1]

    walk = [start]
    while len(walk) < walk_length:
        cur = walk[-1]
        candidates = []
        for node in G[cur]:
            if schema == '' or node_type[node] == schema_items[len(walk) % (len(schema_items) - 1)]:
                candidates.append(node)
        if candidates:
            walk.append(rand.choice(candidates))
        else:
            break
    return [str(node) for node in walk]

The walk doesn't consider edge types which is required in the paper's section 4.3 description.

To be specific, given a view r of the network

@Wang-Yu-Qing
Copy link
Author

I found that the walk is done upon sub-graph of one specific edge type.

@viviqi
Copy link

viviqi commented Sep 14, 2021

Actually I have the same opinion with you, schema based random walk sample walks on one specific layer, which means relation type is fixed when sample one random walk sequence.

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

2 participants