Created
January 27, 2021 14:08
-
-
Save kingjr/705ed2be5bd6ba15c4eea90dfefc6ea5 to your computer and use it in GitHub Desktop.
juliette hypotheses
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
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
fig, axes = plt.subplots(6, 1, sharex=True, sharey=True, figsize=[4, 6]) | |
np.random.seed(1) | |
hypotheses = ( | |
('No Similarity', np.random.randn(5)/1e1), | |
('Inductive bias', np.ones(5) * .5), | |
('Sound-specific similarity', [0, .8, .8, .8, .8]), | |
('Speech-specific similarity', [0, 0, .8, .8, .8]), | |
('Phoneme-specific similarity', [0, 0, 0, .8, .8]), | |
('Language-specific similarity', [0, 0, 0, 0, .8]), | |
) | |
for ax, (title, y) in zip(axes, hypotheses): | |
ax.set_title(title) | |
sns.barplot(x=np.arange(5), y=y, palette='tab10', ax=ax) | |
sns.despine(ax=ax, right=True, top=True) | |
ax.axhline(0, color='k', ls=':') | |
ax.set_yticks([]) | |
ax.set_ylabel('R', rotation=0, labelpad=10) | |
ax.set_xticklabels(['Init', 'Noise', 'Bengali', 'English', 'Dutch']) | |
fig.tight_layout() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment