Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relevant weights if not all contexts run equally #1408

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion nevergrad/benchmark/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,21 @@ def make_data(df: pd.DataFrame, normalized_loss: bool = False) -> tp.Dict[str, t
["optimizer_name", "budget", "loss"] + (["pseudotime"] if "pseudotime" in df.columns else []),
]
)
groupeddf = df.groupby(["optimizer_name", "budget"])
# We first aggregate equivalent rows. The only point of this is that we want all contexts to have the same
# weight, in e.g. xpresults_all.png, even if not all contexts have been run the same number of times.
descriptors = sorted(
set(df.columns)
- {
"pseudotime",
"time",
"elapsed_time",
"elapsed_budget",
"loss",
"seed",
}
)
compact_df = df.groupby(list(descriptors)).mean() # We first aggregate equal contexts.
groupeddf = compact_df.groupby(["optimizer_name", "budget"])
means = groupeddf.mean()
stds = groupeddf.std()
optim_vals: tp.Dict[str, tp.Dict[str, np.ndarray]] = {}
Expand Down