Add CPU unit tests for models/rf3 (losses, layers, metrics, sampler)#314
Closed
lyskov-ai wants to merge 6 commits into
Closed
Add CPU unit tests for models/rf3 (losses, layers, metrics, sampler)#314lyskov-ai wants to merge 6 commits into
lyskov-ai wants to merge 6 commits into
Conversation
…_module Cover the pure numeric helpers in rf3.loss.loss and rf3.util_module: - calc_ddihedralmse_dxyz: the hand-derived closed-form dihedral-loss gradient, pinned against torch.autograd of a mirrored forward, plus zero-at-truth and leading-dim shape preservation. - calc_chiral_grads_flat_impl: empty-centres, scatter routing onto only the centre atoms, index_add_ accumulation for shared atoms, and the no_grad_on_chiral_center flag. - rbf: Gaussian distance-encoding (feature dim, exact values, [0,1]). - init_lecun_normal: module returned, Parameter weight, +/-2*stddev bound, and Lecun std sqrt(scale/fan_in). Test-only; both modules are already mypy-clean. Tests run in float32 (the production coordinate dtype). Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
…duct layer Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
…helpers Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Contributor
Author
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.
Adds fixture-backed CPU unit tests for
models/rf3, with no source changes. The tests pin the model's pure numeric and behavioural contracts using tiny committed fixtures (no GPU, downloaded checkpoints, or cluster data), so they run in the standard CI environment.What's covered:
layer_utilsshape helpers, the MLFF conformer embedding, triangle attention/multiplication (vanilla CPU path), and the outer-product mean.Why: building out test coverage of
models/rf3ahead of refactoring work, as a regression net that pins current behaviour.