Skip to content

Instantly share code, notes, and snippets.

@kingjr
Created January 27, 2021 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingjr/705ed2be5bd6ba15c4eea90dfefc6ea5 to your computer and use it in GitHub Desktop.
Save kingjr/705ed2be5bd6ba15c4eea90dfefc6ea5 to your computer and use it in GitHub Desktop.
juliette hypotheses
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