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

The code seems not to be the same as in the paper #13

Open
keyboardpianist opened this issue May 9, 2021 · 2 comments
Open

The code seems not to be the same as in the paper #13

keyboardpianist opened this issue May 9, 2021 · 2 comments

Comments

@keyboardpianist
Copy link

keyboardpianist commented May 9, 2021

In preprocess.py it generates context pairs during 1 to T, and the model learned from 1 to T to predict link in time T?

def get_context_pairs(graphs, num_time_steps):
    """ Load/generate context pairs for each snapshot through random walk sampling."""
    load_path = "data/{}/train_pairs_n2v_{}.pkl".format(FLAGS.dataset, str(num_time_steps - 2))
    try:
        context_pairs_train = dill.load(open(load_path, 'rb'))
        print("Loaded context pairs from pkl file directly")
    except (IOError, EOFError):
        print("Computing training pairs ...")
        context_pairs_train = []
        for i in range(0, num_time_steps):
            context_pairs_train.append(run_random_walks_n2v(graphs[i], graphs[i].nodes()))
        dill.dump(context_pairs_train, open(load_path, 'wb'))
        print ("Saved pairs")

    return context_pairs_train

maybe for i in range(0, num_time_steps - 1):?

@zhaohaixiangbobo
Copy link

in the mian function ,it replace the graph[-1] edge with graph[-2] edge

@trytodoit227
Copy link

hello, do you know how to generate negative samples in models.py

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

3 participants