Skip to content

Commit ccea571

Browse files
committed
Add a --no-optimize-images
1 parent 2e1d241 commit ccea571

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

notebooks_jason/max_of_K_all_models.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@
142142
default=False,
143143
help="Only optimize images, then quit",
144144
)
145+
parser.add_argument(
146+
"--optimize-images",
147+
action=BooleanOptionalAction,
148+
default=True,
149+
help="Optimize images",
150+
)
145151
parser.add_argument(
146152
"--individual-plots",
147153
action=BooleanOptionalAction,
@@ -281,6 +287,7 @@
281287
N_THREADS: Optional[int] = cli_args.n_threads
282288
DISPLAY_PLOTS: bool = False # @param {type:"boolean"}
283289
SAVE_PLOTS: bool = cli_args.plots
290+
OPTIMIZE_IMAGES: bool = cli_args.optimize_images
284291
RENDERER: Optional[str] = "png" # @param ["png", None]
285292
PLOT_WITH: Literal["plotly", "matplotlib"] = ( # @param ["plotly", "matplotlib"]
286293
"matplotlib"
@@ -416,8 +423,8 @@ def optimize_pngs(errs: list[Exception] = []):
416423
from gbmi.exp_max_of_n.plot import (
417424
EVOU_max_minus_diag_logit_diff,
418425
attention_difference_over_gap,
419-
display_basic_interpretation,
420426
compute_basic_interpretation_axis_limits,
427+
display_basic_interpretation,
421428
display_EQKE_SVD_analysis,
422429
hist_attention_difference_over_gap,
423430
hist_EVOU_max_minus_diag_logit_diff,
@@ -4118,7 +4125,7 @@ def texify(s: Optional[str]) -> Optional[str]:
41184125
del latex_figures
41194126
gc.collect()
41204127
# %%
4121-
if SAVE_PLOTS:
4128+
if SAVE_PLOTS and OPTIMIZE_IMAGES:
41224129
optimize_pngs()
41234130

41244131
print_and_raise_errs()

0 commit comments

Comments
 (0)