Repository navigation
Implement SAC online adaptation under distribution shift (#273) - #307
Open
AryanXCode646 wants to merge 2 commits into
Open
AryanXCode646 wants to merge 2 commits into
AryanXCode646 wants to merge 2 commits into
Conversation
… shift (Issue StellarResearch#273) - Add sac_shift_runner.py with full protocol compliance (nominal training, checkpoint freeze, shock window, fork, B5-B14 update blocks, and recovery analysis) - Guard optional heavy dependencies (torch, stable-baselines3) in ppo.py and sac.py with informative error messages - Add test_sac_adaptation.py to verify protocol invariants with graceful skip when heavy dependencies are absent - Update docs/research/TREATMENT_CARD.md with SAC online adaptation specifications, hyperparameters, and audit requirements
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.
Summary
This PR implements Soft Actor-Critic (SAC) online adaptation under distribution shift, achieving parity with the existing PPO adaptation workflow.
Closes #273
Key Changes
1. SAC Online Adaptation
sac_shift_runner.pyfor the SAC adaptation experiment.2. Replay Buffer Isolation
3. Adaptation Workflow
4. Audit and Recovery
5. Statistical Error Handling
insufficient_data.not_estimable.insufficient_replicates.MIN_VALID_N = 8threshold.6. Tests and Documentation
Validation
Reported local validation:
pytest -q: 210 passed.git diff --check: no reported errors.Research Integrity
The implementation preserves the existing SAC loss formulation, research protocol constants, recovery methodology, post-shift replay isolation, and B5–B14 adaptation schedule.
No changes to the frozen minimum replicate threshold.
Scope
This PR addresses GitHub Issue #273 and adds SAC support for online adaptation under distribution shift.