|
142 | 142 | default=False,
|
143 | 143 | help="Only optimize images, then quit",
|
144 | 144 | )
|
| 145 | +parser.add_argument( |
| 146 | + "--optimize-images", |
| 147 | + action=BooleanOptionalAction, |
| 148 | + default=True, |
| 149 | + help="Optimize images", |
| 150 | +) |
145 | 151 | parser.add_argument(
|
146 | 152 | "--individual-plots",
|
147 | 153 | action=BooleanOptionalAction,
|
|
281 | 287 | N_THREADS: Optional[int] = cli_args.n_threads
|
282 | 288 | DISPLAY_PLOTS: bool = False # @param {type:"boolean"}
|
283 | 289 | SAVE_PLOTS: bool = cli_args.plots
|
| 290 | +OPTIMIZE_IMAGES: bool = cli_args.optimize_images |
284 | 291 | RENDERER: Optional[str] = "png" # @param ["png", None]
|
285 | 292 | PLOT_WITH: Literal["plotly", "matplotlib"] = ( # @param ["plotly", "matplotlib"]
|
286 | 293 | "matplotlib"
|
@@ -416,8 +423,8 @@ def optimize_pngs(errs: list[Exception] = []):
|
416 | 423 | from gbmi.exp_max_of_n.plot import (
|
417 | 424 | EVOU_max_minus_diag_logit_diff,
|
418 | 425 | attention_difference_over_gap,
|
419 |
| - display_basic_interpretation, |
420 | 426 | compute_basic_interpretation_axis_limits,
|
| 427 | + display_basic_interpretation, |
421 | 428 | display_EQKE_SVD_analysis,
|
422 | 429 | hist_attention_difference_over_gap,
|
423 | 430 | hist_EVOU_max_minus_diag_logit_diff,
|
@@ -4118,7 +4125,7 @@ def texify(s: Optional[str]) -> Optional[str]:
|
4118 | 4125 | del latex_figures
|
4119 | 4126 | gc.collect()
|
4120 | 4127 | # %%
|
4121 |
| -if SAVE_PLOTS: |
| 4128 | +if SAVE_PLOTS and OPTIMIZE_IMAGES: |
4122 | 4129 | optimize_pngs()
|
4123 | 4130 |
|
4124 | 4131 | print_and_raise_errs()
|
|
0 commit comments