-
Notifications
You must be signed in to change notification settings - Fork 9
[KGE] Add evaluate logic #343
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
base: main
Are you sure you want to change the base?
Conversation
python/gigl/experimental/knowledge_graph_embedding/lib/evaluation.py
Outdated
Show resolved
Hide resolved
python/gigl/experimental/knowledge_graph_embedding/lib/evaluation.py
Outdated
Show resolved
Hide resolved
python/gigl/experimental/knowledge_graph_embedding/lib/evaluation.py
Outdated
Show resolved
Hide resolved
| def compute_final_metrics( | ||
| self, | ||
| unique_edge_types: List[CondensedEdgeType], | ||
| ) -> EvaluationResult: |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this 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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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]
...
Add code which computes the evaluation metrics for KGE training.
Main entrypoint is
evaluatewhich 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