(Go: >> BACK << -|- >> HOME <<)

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

🇨🇴🕸️ Add co-occurence filtered meta model #943

Merged
merged 32 commits into from
May 31, 2022
Merged

Conversation

mberr
Copy link
Member
@mberr mberr commented May 27, 2022

This PR adds a meta-model which wraps a base model and masks out scores for entities which do not co-occur with a relation (in the training set).

It can also be used to wrap an already trained model.

Similar techniques have been applied in the winning approaches of the OGB-LSC challenge, although there, valid/test triples were also included.

In theory, we could also apply some sort of (soft) masking already during training to enable the model to ignore scores which will be filtered at evaluation time anyway.

@cthoyt cthoyt mentioned this pull request May 28, 2022
3 tasks
@mberr mberr marked this pull request as ready for review May 30, 2022 11:42
@mberr mberr changed the title Add co-occurence filtered meta model 🇨🇴🕸️ Add co-occurence filtered meta model May 30, 2022
@mberr
Copy link
Member Author
mberr commented May 30, 2022

@PyKEEN-bot test

@@ -23,13 +23,33 @@ def get_csr_matrix(
row_indices: numpy.ndarray,
col_indices: numpy.ndarray,
shape: Tuple[int, int],
dtype: numpy.dtype = numpy.float32,
normalize: bool = True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can imagine we ever want a norm besides l1, you could change this to be an Optional[str] and have set to "l1" as default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member
@cthoyt cthoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two minor comments for docs so if you want to go back and address them that's fine otherwise :shipit:

@mberr mberr merged commit 3cb08cc into master May 31, 2022
@mberr mberr deleted the pseudo-type-filter branch May 31, 2022 12:18
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

Successfully merging this pull request may close these issues.

None yet

3 participants