def get_args() -> argparse.Namespace:
"""Parse command-line arguments for equalization."""
parser = argparse.ArgumentParser(
description="Rescale a raw-frontend model's bands so each gets the same share of its INT8 grids. "
"Exact in float; run it on a trained float checkpoint before QAT or conversion."
)
parser.add_argument("--checkpoint_path", type=str, required=True, help="Trained float .keras model (raw frontend)")
parser.add_argument("--model_config", type=str, default="", help="Path to model config JSON")
parser.add_argument("--data_path_train", type=str, required=True, help="Training data directory")
parser.add_argument("--output_path", type=str, required=True, help="Output .keras path")
parser.add_argument(
"--num_samples",
type=int,
default=1024,
help="Stratified calibration files, drawn as by convert (seed 42)",
)
parser.add_argument(
"--gain_samples",
type=int,
default=512,
help=f"Calibration inputs that set the gains; the next {CHECK_SAMPLES} check float identity",
)
parser.add_argument("--stages", default=",".join(STAGES), help=f"Comma-separated subset of {','.join(STAGES)}")
return parser.parse_args()