Skip to content
Discussion options

You must be logged in to vote

For any one who is interested I solved this by using a simple classifier that performs dot product rather than the edge decoder stated above.

Also linear layers to the model to handle different features dimensions for the different node types.

class Classifier(torch.nn.Module):
    def forward(self, x_user, x_item, edge_label_index):
        # Convert node embeddings to edge-level representations:
        edge_feat_user = x_user[edge_label_index[0]]
        edge_feat_item = x_item[edge_label_index[1]]
        # Apply dot-product to get a prediction per supervision edge:
        return (edge_feat_user * edge_feat_item).sum(dim=-1)


class Model(torch.nn.Module):
    def __init__(self, hidd…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mzamini92
Comment options

@farazmah
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by farazmah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants