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

Accessing Embedded Space & Decoder Inquiry #20

Closed
jessxphil opened this issue Jun 24, 2021 · 2 comments
Closed

Accessing Embedded Space & Decoder Inquiry #20

jessxphil opened this issue Jun 24, 2021 · 2 comments

Comments

@jessxphil
Copy link

Thank you in advance for your help!

I don't want to use up too much of your time so I'll try to write a few concise questions.

  1. I ran the 'Train' code but the preloaded model didn't update according to the new weights/bias from my personal data. How can I make sure I'm training the model according to my data?

  2. I'm looking to extract the embedded space to use as input features for another model. Just to confirm, is that embedded space stored in the 'pred' variable from the Train.py? [Note: pred = model(emb_as, emb_bs) #Line 131 or pred = pred.argmax(dim=-1) #Line 148]

ALSO There's another embedded space variable from the Analyze_Embedding.pybd. [Note: embs = model.emb_model(batch).detach().cpu().numpy() #Line 79]

  1. Can I use the 'Decoder' on the extracted embedded space to retrieve my graph data?
@qema
Copy link
Collaborator

qema commented Jun 28, 2021

Thanks for your interest!

  1. See the experimental branch (How to train the encoder for our own data? (A Knowledge graph and sample query) #16 (comment)) and the suggested workaround in that thread for a way to train on custom datasets while making use of node features.
  2. To get a graph's embedding, use embs = model.emb_model(batch).detach().cpu().numpy(). See
    embs = model.emb_model(batch)
    for an example.
  3. The subgraph mining component only finds frequent graphs that are contained in a given region of the embedding space; in general it's quite tricky to decode from an arbitrary point in the embedding space back to a graph, since most points in the space might not exactly correspond to any graph. If possible, it's usually best to maintain both a graph and its embedding together.

@jessxphil
Copy link
Author

Thank you for the clear explanation! I really appreciate your help!

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