Skip to content
Discussion options

You must be logged in to vote

I personally think the easiest way to do this would be via stacking of labels in a separate batch dimension and utilize padding (e.g., via to_dense_batch). I think you need to do this anyway inside the model, and so there doesn't exist a good reason to not do it already during batch creation. Then, you can directly compare z and y and compute BCE loss on top, e.g., via:

    z, mask = to_dense_batch(z, batch_index)
    z_t = z.transpose(1, 2)
    # Compute a prediction for every edge using `z` and `z_t`:
    pred = ...
    return bce_loss(pred[mask], y[mask])

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@vietngth
Comment options

@rusty1s
Comment options

@vietngth
Comment options

@rusty1s
Comment options

@vietngth
Comment options

Answer selected by vietngth
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