Add paper-aligned trap metrics, FFT/burden variants, and trap verification/remove workflow#359
Open
charlesmartin14 wants to merge 1 commit intomasterfrom
Open
Conversation
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.
Motivation
remove_traps.Description
trap_burden_variants.py,trap_fourier.py, andtrap_identity.pyimplementing burden-variant math, Fourier/FFT diagnostics, and permutation/trap identity & verification helpers.trap_delta,trap_ipr,trap_q,trap_diffuseness,trap_top_sector_overlap,trap_variance_burden,layer_trap_variance_burden) and optional burden variants and FFT-derived columns, plus optionsburden_variants,return_burden_components,return_burden_raw,trap_fftandtrap_fft_config.perm_signature,permutation_n,trap_seed,trap_identity_key) and verification tooling used byremove_traps;remove_trapsgained parametersverify_traps,return_analyze,traps,rtol,atol, andmin_vector_cosine, and can return a verification dataframe when requested.trap_analysis.pyand hooks them intoweightwatcher.WeightWatcher(new helper methods:compute_trap_delta,compute_trap_ipr_q,compute_trap_ipr_q_uniform,compute_top_sector_overlap,compute_trap_variance_burden, andcompute_original_basis_for_traps), and preserves legacy heuristics for backward compatibility.Testing
tests/test_analyze_traps.py(expanded to cover new paper metrics, top-sector behavior, and index conventions), and they passed.tests/test_trap_burden_variants.pycovering burden math and API behavior, andtests/test_trap_fft.pycovering Fourier helpers and integration hooks, and these tests passed.tests/test_remove_traps.pywith verification/return_analyze tests exercising the newremove_trapsbehavior, and those tests passed (torch-dependent tests are skipped when PyTorch is unavailable).Codex Task