Repository navigation
Add DirectionReconstructionWithLogKappa - #929
Conversation
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.
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>
4ea0c9e to
544d07f
Compare
|
@christianlocatelli, thanks for taking a look at it! I agree with you guys and reduced the tests. |
christianlocatelli
left a comment
There was a problem hiding this comment.
@sevmag go for it!
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