[examples] Add a --only-nonzero-reward flag to info.
@@ -33,12 +33,19 @@ def info(
log_dirs: List[Path] = ["~/logs/compiler_gym/llvm_autotuning"],
all_runs: bool = False,
group_by_working_directory: bool = False,
+ only_nonzero_reward: bool = False,
):
experiments = experiments_from_paths(log_dirs)
results = []
for experiment in experiments:
df = experiment.dataframe
+
+ # Exclude runs where reward was zero, used for pruning false results if
+ # the environment is flaky or can fail.
+ if only_nonzero_reward:
+ df = df[df.reward != 0]
+
if not len(df):
continue
