Repository navigation
Conversation
Predicts kappa as kappa_min + exp(x[:, 3]) instead of the output norm, removing the kappa ceiling of DirectionReconstructionWithKappa. Refs graphnet-team#928 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
christianlocatelli
self-requested a review
October 12, 2026 08:24
Collaborator
There was a problem hiding this comment.
Thanks for the PR @sevmag. Everything looks good and reasonable overall. I discussed the test functions with Aske though, and we think most of them aren't really necessary and are unlikely to catch future bugs.
test_log_kappa_direction_output, test_log_kappa_no_ceiling_and_no_overflow, and test_log_kappa_floor_must_be_positive mostly restate the _forward function and are clear from the code, would it be possible to remove them?
test_log_kappa_loss_and_gradients could arguably still be kept, because it checks the new head together with VonMisesFisher3DLoss, and a change in either of them could break the other. Let us know what you think about it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #928.
Adds
DirectionReconstructionWithLogKappa: direction from the normalised first three outputs,kappa = kappa_min + exp(x[:, 3])(kappa_mindefault 1). Same prediction layout asDirectionReconstructionWithKappa, so it works withVonMisesFisher3DLossunchanged. The docstring ofDirectionReconstructionWithKappanow notes its kappa ceiling and points to the new task.Tests added in
tests/models/test_task.py.🤖 Generated with Claude Code