Skip to content

Conversation

@nshah-sc
Copy link
Collaborator

Add code which computes the evaluation metrics for KGE training.

Main entrypoint is evaluate which just calls other private functions for organization.

Where is the documentation for this feature?: N/A

Did you add automated tests or write a test plan?

Updated Changelog.md? NO

Ready for code review?: YES

Comment on lines +147 to +150
def compute_final_metrics(
self,
unique_edge_types: List[CondensedEdgeType],
) -> EvaluationResult:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

currently keeping this API because other code that i haven't pushed relies on this and will be a mess to manage this change, however i can anticipate in future dropping EvaluationResult and EdgeTypeMetrics to instead just interface with the EvaluationMetricsAccumulator itself.

@svij-sc svij-sc self-requested a review October 23, 2025 22:52
Copy link
Collaborator

@svij-sc svij-sc left a comment

Choose a reason for hiding this comment

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

Thanks


# Restore original model state
pipeline._model.module.set_phase(original_phase)
pipeline._model.train()
Copy link
Collaborator

Choose a reason for hiding this comment

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

only enable training if "was_training" before?


# Process each edge type
for edge_type, idx in self._edge_type_to_idx.items():
edge_type_mask = condensed_edge_types == edge_type
Copy link
Collaborator

Choose a reason for hiding this comment

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

flip this so you iterate through condensed_edge_types instead?
i.e.

for condensed_edge_type in condensed_edge_types:
   idx = _edge_type_to_idx[condensed_edge_type]
   ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants