Skip to content

Add bulk-mode detection and removal to remove_traps (explicit and random bulk vectors)#361

Open
charlesmartin14 wants to merge 1 commit intomasterfrom
codex/remove-random-bulk-vectors-from-pr-360
Open

Add bulk-mode detection and removal to remove_traps (explicit and random bulk vectors)#361
charlesmartin14 wants to merge 1 commit intomasterfrom
codex/remove-random-bulk-vectors-from-pr-360

Conversation

@charlesmartin14
Copy link
Copy Markdown
Member

Motivation

  • Extend the trap-removal workflow to also identify and remove bulk rank-1 vectors, and to support removing either explicit bulk vectors or a requested number of randomly-chosen bulk vectors.

Description

  • Add identify_bulk_mode_indices to classify bulk modes (<= TW threshold) in a layer using the same MP/TW logic as traps.
  • Add collect_bulk_artifacts to extract bulk-mode artifacts via the existing permute + MP/TW analysis pipeline.
  • Extend apply_remove_traps and remove_traps to accept new parameters bulk_indices and num_random_bulk_vectors, to validate indices, and to support removing both traps and bulk vectors by replacing their rank-1 contributions with make_stat_matched_random_matrix draws.
  • Update WeightWatcher wrappers (apply_remove_traps and remove_traps) to expose the new bulk_indices and num_random_bulk_vectors arguments and update docstrings accordingly.

Testing

  • Ran the new unit tests tests/test_remove_traps.py::test_remove_traps_can_remove_explicit_bulk_vector and tests/test_remove_traps.py::test_remove_traps_can_remove_random_bulk_vector, and the existing test_remove_traps_invalid_indices_warns_and_skips, and they all passed under pytest.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant