-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from EleutherAI/categories_across_scale_time
Categories Across Scale & Time
- Loading branch information
Showing
22 changed files
with
5,334 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from scipy.stats import entropy | ||
|
||
def calculate_kl_divergence(all_memories_and_sample, memories_dataset, duplication_count): | ||
all_memories_bootstrap_sample = all_memories_and_sample[all_memories_and_sample["sequence_duplicates"] == duplication_count].sample(frac=1, replace=True) | ||
memories_at_duplication_count = memories_dataset[memories_dataset["sequence_duplicates"] == duplication_count]["generation_perplexity"] | ||
non_memories_at_duplication_count = all_memories_bootstrap_sample[all_memories_bootstrap_sample["sequence_duplicates"] == duplication_count]["generation_perplexity"] | ||
|
||
# downsample to calculate kl divergence | ||
balance_size = min(len(memories_at_duplication_count), len(non_memories_at_duplication_count)) | ||
memories_at_duplication_count = memories_at_duplication_count.sample(balance_size) | ||
non_memories_at_duplication_count = non_memories_at_duplication_count.sample(balance_size) | ||
|
||
# generate kl divergence in perplexity with memories as the true distribution | ||
kl_divergence = entropy(memories_at_duplication_count, non_memories_at_duplication_count) | ||
return { | ||
"Duplicates": duplication_count, | ||
"KL Divergence": kl_divergence | ||
} |
Binary file removed
BIN
-81.7 KB
working_dirs/kyle/results_analysis/figure_categories_count_percents.png
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
1,296 changes: 1,296 additions & 0 deletions
1,296
working_dirs/kyle/results_analysis/ppl_dup_figure.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
2,784 changes: 2,496 additions & 288 deletions
2,784
working_dirs/kyle/results_analysis/results_analysis.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
885 changes: 850 additions & 35 deletions
885
working_dirs/kyle/results_analysis/results_analysis_whole_sequence.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+27 KB
...g_dirs/kyle/results_analysis/scale+time_figures/ppl_figs/kl_divergence_generation_ppl.pdf
Binary file not shown.
Binary file added
BIN
+33.2 KB
...esults_analysis/scale+time_figures/ppl_figs/kl_divergence_generation_ppl_bootstrapped.pdf
Binary file not shown.
Binary file added
BIN
+16.1 KB
...nalysis/scale+time_figures/recitation_threshold_2/categories_counts_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+18.5 KB
...cale+time_figures/recitation_threshold_2/categories_counts_percents_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+18.6 KB
...ures/recitation_threshold_2/categories_counts_percents_across_time+scale_bounded_bars.pdf
Binary file not shown.
Binary file added
BIN
+15.5 KB
...lysis/scale+time_figures/recitation_threshold_2/categories_percents_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+15.4 KB
...nalysis/scale+time_figures/recitation_threshold_5/categories_counts_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+18.1 KB
...cale+time_figures/recitation_threshold_5/categories_counts_percents_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+18.1 KB
...ures/recitation_threshold_5/categories_counts_percents_across_time+scale_bounded_bars.pdf
Binary file not shown.
Binary file added
BIN
+15.1 KB
...lysis/scale+time_figures/recitation_threshold_5/categories_percents_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+41.8 KB
...s/kyle/results_analysis/scale+time_figures/recitation_threshold_5/histograms_percents.pdf
Binary file not shown.
Binary file added
BIN
+15.4 KB
...nalysis/scale+time_figures/recitation_threshold_6/categories_counts_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+18.4 KB
...cale+time_figures/recitation_threshold_6/categories_counts_percents_across_time+scale.pdf
Binary file not shown.
Binary file added
BIN
+18.1 KB
...ures/recitation_threshold_6/categories_counts_percents_across_time+scale_bounded_bars.pdf
Binary file not shown.
Binary file added
BIN
+15.4 KB
...lysis/scale+time_figures/recitation_threshold_6/categories_percents_across_time+scale.pdf
Binary file not shown.