Skip to content

Commit

Permalink
move appendix
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixBenning committed May 13, 2024
1 parent f8dcb24 commit 69ed827
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 10 additions & 0 deletions pyrfd/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

from .regression import ScalarRegression

def selection(sorted_list, num_elts):
"""
return a selection of num_elts from the sorted_list (evenly spaced in the index)
always includes the first and last index
"""
if len(sorted_list) < num_elts:
return sorted_list
idxs = np.round(np.linspace(0, len(sorted_list) - 1, num_elts)).astype(int)
return sorted_list[idxs]


def plot_loss(ax, df: pd.DataFrame, *, mean, var_reg: ScalarRegression):
"""
Expand Down
11 changes: 0 additions & 11 deletions pyrfd/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ def intercept(self):
return self.intercept_


def selection(sorted_list, num_elts):
"""
return a selection of num_elts from the sorted_list (evenly spaced in the index)
always includes the first and last index
"""
if len(sorted_list) < num_elts:
return sorted_list
idxs = np.round(np.linspace(0, len(sorted_list) - 1, num_elts)).astype(int)
return sorted_list[idxs]


def fit_mean_var(
batch_sizes: np.array,
batch_losses: np.array,
Expand Down

0 comments on commit 69ed827

Please sign in to comment.