Skip to content

fix(notebook): define 'best' before use in plotting cell#175

Open
tykoo-chen wants to merge 1 commit intokarpathy:masterfrom
tykoo-chen:fix/notebook-undefined-best
Open

fix(notebook): define 'best' before use in plotting cell#175
tykoo-chen wants to merge 1 commit intokarpathy:masterfrom
tykoo-chen:fix/notebook-undefined-best

Conversation

@tykoo-chen
Copy link

Problem

The plotting cell in analysis.ipynb references the variable best on lines 137-138:

margin = (baseline_bpb - best) * 0.15
ax.set_ylim(best - margin, baseline_bpb + margin)

However, best is not defined until the "Summary Statistics" cell which comes later in the notebook. This causes a NameError when running the notebook.

Solution

Add best = running_min.iloc[-1] before the Y-axis limits are set, with a fallback to baseline_bpb for the edge case where no experiments have been kept yet.

Related

The plotting cell references 'best' for Y-axis limits but it was not
defined until the Summary Statistics cell below. This adds the definition
using running_min.iloc[-1] with a fallback to baseline_bpb if no
experiments have been kept yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant