Download scripts/build_matched_random_temporal_proposal.py from mmmmmcyaaa/ReTime: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/mmmmmcyaaa/ReTime/resolve/main/scripts/build_matched_random_temporal_proposal.py
- Command line
-
hf download hf://mmmmmcyaaa/ReTime/scripts/build_matched_random_temporal_proposal.py
-
curl -L -o build_matched_random_temporal_proposal.py https://huggingface.co/mmmmmcyaaa/ReTime/resolve/main/scripts/build_matched_random_temporal_proposal.py
1.56 kB
| """Build the matched-random control by permuting residual masses per trajectory.""" | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| from starVLA.dataloader.infoflow_sampler import ValidAnchorManifest | |
| from starVLA.dataloader.temporal_proposal import TemporalProposal | |
| from starVLA.scoring.matched_random import build_matched_random_proposal | |
| def main() -> None: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--manifest", type=Path, required=True) | |
| parser.add_argument("--residual-proposal", type=Path, required=True) | |
| parser.add_argument("--output", type=Path, required=True) | |
| parser.add_argument("--permutation-seed", type=int, required=True) | |
| args = parser.parse_args() | |
| manifest = ValidAnchorManifest.load(args.manifest) | |
| residual = TemporalProposal.load(args.residual_proposal, manifest) | |
| matched = build_matched_random_proposal( | |
| manifest=manifest, | |
| residual_proposal=residual, | |
| permutation_seed=args.permutation_seed, | |
| ) | |
| matched.save(args.output) | |
| print( | |
| json.dumps( | |
| { | |
| "status": "complete", | |
| "manifest_sha256": manifest.sha256, | |
| "source_proposal_sha256": residual.sha256, | |
| "matched_random_proposal_sha256": matched.sha256, | |
| "permutation_seed": args.permutation_seed, | |
| "output": str(args.output.resolve()), | |
| }, | |
| indent=2, | |
| sort_keys=True, | |
| ) | |
| ) | |
| if __name__ == "__main__": | |
| main() | |