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

Unsupervised Learning (MVRGL) #182

Open
MarkSttc opened this issue Feb 1, 2023 · 1 comment
Open

Unsupervised Learning (MVRGL) #182

MarkSttc opened this issue Feb 1, 2023 · 1 comment
Labels
sslgraph Self-supervised Learning on Graphs

Comments

@MarkSttc
Copy link

MarkSttc commented Feb 1, 2023

Thank you so much for the amazing work. This really help me a lot throughout my research period.

However, May I know how to train the model without using the eval method? I just want the trained model from contrastive lost only. and later will be visualized in the TSNE. Therefore, accuracy doesn't matter to me. Currently, I'm working with my own dataset for graph classification as downstream task.

Initially, I have tried using mvgrl.train() but seems like there is no learning progress and it gave me the error as well. Please find the attaches below for more clarification.

image

image
image

@ycremar
Copy link
Collaborator

ycremar commented Feb 14, 2023

Hi @MarkSttc , thank you for your interest and question. You can definitely train encoders in contrastive manner for other tasks.

The simplest way is that you normally do the evaluation process. After the training and evaluation is finished, you can just take encoder_adj and encoder_diff to perform any other tasks since their parameters are already updated.

If you want to skip the evaluation, you can also do

list(mvgrl.train(encoder, dataloader, optimizer, epochs))
encoder_adj.eval()
encoder_diff.eval()
with torch.no_grad():
    embeds_adj = encoder_adj(data)
    embeds_diff = encoder_diff(data)

@mengliu1998 mengliu1998 added the sslgraph Self-supervised Learning on Graphs label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sslgraph Self-supervised Learning on Graphs
Projects
None yet
Development

No branches or pull requests

3 participants