Skip to content

Commit

Permalink
compute correlations of ..
Browse files Browse the repository at this point in the history
size and quantisation with accuracy (there is none)
  • Loading branch information
slobentanzer committed Feb 9, 2024
1 parent 5fde56a commit 054ede9
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 0 deletions.
Binary file modified docs/images/boxplot-naive-vs-biochatter.pdf
Binary file not shown.
Binary file modified docs/images/scatter-per-quantisation-name.pdf
Binary file not shown.
Binary file added docs/images/scatter-quantisation-accuracy.pdf
Binary file not shown.
Binary file added docs/images/scatter-quantisation-accuracy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/scatter-size-accuracy.pdf
Binary file not shown.
Binary file added docs/images/scatter-size-accuracy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/scripts/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,52 @@ def plot_comparison_naive_biochatter(overview):

# TODO publish this test and other related ones on website as well?

# calculate correlation between LLM size and accuracy for all tasks
# convert size to float, make Unknown = 300, replace commas with dots
size = overview_melted["Size"].apply(
lambda x: 300 if x == "Unknown" else float(x.replace(",", "."))
)
print(size.corr(overview_melted["Accuracy"]))
# plot scatter plot
plt.figure(figsize=(6, 4))
sns.scatterplot(x=size, y=overview_melted["Accuracy"])
plt.xlabel("Model size (billions of parameters)")
plt.ylabel("Accuracy")
plt.title("Scatter plot of model size vs accuracy")
plt.savefig(
f"docs/images/scatter-size-accuracy.png",
bbox_inches="tight",
dpi=300,
)
plt.savefig(
f"docs/images/scatter-size-accuracy.pdf",
bbox_inches="tight",
)
plt.close()

# calculate correlation between quantisation and accuracy for all tasks
# convert quantisation to float, make >= 16-bit* = 16, replace -bit with nothing
quantisation = overview_melted["Quantisation"].apply(
lambda x: 16 if x == ">= 16-bit*" else float(x.replace("-bit", ""))
)
print(quantisation.corr(overview_melted["Accuracy"]))
# plot scatter plot
plt.figure(figsize=(6, 4))
sns.scatterplot(x=quantisation, y=overview_melted["Accuracy"])
plt.xlabel("Quantisation (bits)")
plt.ylabel("Accuracy")
plt.title("Scatter plot of quantisation vs accuracy")
plt.savefig(
f"docs/images/scatter-quantisation-accuracy.png",
bbox_inches="tight",
dpi=300,
)
plt.savefig(
f"docs/images/scatter-quantisation-accuracy.pdf",
bbox_inches="tight",
)
plt.close()


def melt_and_process(overview):
overview_melted = overview.melt(
Expand Down

0 comments on commit 054ede9

Please sign in to comment.