Molecule Graph Generation #4325
-
This question is regarding molecule generation using Variational Graph Autoencoders (VGAE). While following this example given as an example for VGAE in PyG, I ended up having two questions:-
which outputs the following:
what interrupts my progress is to understand what these
which outputs the following reconstructed probabilistic dense adjacency matrix (I'm including here only a small part of it):
Above reconstructed adjacency matrix has size of (29, 29) as original test_data's graph has 29 nodes in total. Suggestion about how to visualize the graph that resulted from this reconstructed adjacency matrix would be highly appreciated as this matrix has probabilities for each of the 841 (29 X 29) edges and which edge must exist for each of the 29 nodes in the graph is simply just unclear to me. In other words, we must have 0 and 1 values in the adjacency matrix to identify which edge connects the two nodes but here are just probabilities. So, do I need to somehow convert these probabilities to binary values (0 and 1) or is there any workaround to easily plot the graph using this "decoder yielded" reconstructed probabilistic dense adjacency matrix?? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
z = model(x, edge_index) # obtain node embeddings
pos_loss = compute_loss((z[pos_edge_index_label[0]] * z[pos_edge_index_label[1]]).sum(dim=-1), pos_edge_label)
neg_loss = compute_loss((z[neg_edge_index_label[0]] * z[neg_edge_index_label[1]]).sum(dim=-1), neg_edge_label)
|
Beta Was this translation helpful? Give feedback.
-
Thanks @rusty1s for your prompt response. This truly answers all of my questions. Thanks a lot!!! |
Beta Was this translation helpful? Give feedback.
pos_edge_label_index
andneg_edge_label_index
denote the positive and negative links which are used for training the model via supervision.pos_edge_label
andneg_edge_label
hold their ground-truth labels (1
and0
, respectively). As such, you can trainVGAE
via