<jupyter_start><jupyter_text>Examples<jupyter_code>%run /home/ejp/src/bluemass/bm.py ../data/fig3/ ../pars/test_asyncpac.yaml -t 2.0 --stim_seed 32 --sigma 20 --loc r_E
res = load_kdf("../data/fig3/result.hdf5")
idx = load_kdf("../data/fig3/index.hdf5")

ys = res['ys']
times = res['times']
stim = res['stims'][:,0]

# ignore eq time
drop_before = 0.5
ys = ys[times > drop_before, :]
stim = stim[times > drop_before]
times = times[times > drop_before]

re = ys[:, idx['r_E']]
ri = ys[:, idx['r_I']]

def norm(x):
    return (x - x.min()) / (x.max() - x.min())
    
# --
n = 100
plt.figure(figsize=(4 , 3))

plt.subplot(n + 11)
plt.plot(times, re.max() * (stim/stim.max()), color='purple',
         alpha=0.4, label='Stimulus', linewidth=3)
plt.plot(times, re, label='Rate E', color='k', linewidth=2)
plt.plot(times, ri, label='Rate I', color='r', alpha=0.6, linewidth=3)
plt.legend(loc='upper right', frameon=False)
plt.xlim(1.1, 1.7)
plt.xlabel("Time (s)")
plt.ylabel("Rate (Hz)")
plt.axis('off')
%run /home/ejp/src/bluemass/bm.py ../data/fig3/ ../pars/test_oscpac.yaml -t 2.0 --stim_seed 32 --sigma 20 --loc r_E
res = load_kdf("../data/fig3/result.hdf5")
idx = load_kdf("../data/fig3/index.hdf5")

ys = res['ys']
times = res['times']
stim = res['stims'][:,0]

# ignore eq time
drop_before = 0.5
ys = ys[times > drop_before, :]
stim = stim[times > drop_before]
times = times[times > drop_before]

re = ys[:, idx['r_E']]
ri = ys[:, idx['r_I']]

def norm(x):
    return (x - x.min()) / (x.max() - x.min())
    
# --
n = 100
plt.figure(figsize=(4 , 3))

plt.subplot(n + 11)
plt.plot(times, re.max() * (stim/stim.max()), color='purple',
         alpha=0.4, label='Stimulus', linewidth=3)
plt.plot(times, re, label='Rate E', color='k', linewidth=2)
plt.plot(times, ri, label='Rate I', color='r', alpha=0.6, linewidth=3)
plt.legend(loc='upper right', frameon=False)
plt.xlim(1.1, 1.7)
plt.xlabel("Time (s)")
plt.ylabel("Rate (Hz)")
plt.axis('off')<jupyter_output><empty_output><jupyter_text>Phase-phase<jupyter_code>%run /home/ejp/src/bluemass/bm.py ../data/fig3/ ../pars/fig3/phase_diff_ph0.yaml -t 2.0 --stim_seed 32 --sigma 10 --loc r_E
res0 = load_kdf("../data/fig3/result.hdf5")
idx0 = load_kdf("../data/fig3/index.hdf5")
%run /home/ejp/src/bluemass/bm.py ../data/fig3/ ../pars/fig3/phase_diff_ph90.yaml -t 2.0 --stim_seed 32 --sigma 10 --loc r_E
res90 = load_kdf("../data/fig3/result.hdf5")
idx90 = load_kdf("../data/fig3/index.hdf5")
ys0 = res0['ys']
ys90 = res90['ys']
stim = res['stims'][:,0]
re0 = ys0[:, idx0['r_E']]
re90 = ys90[:, idx0['r_E']]
# --
n = 100
plt.figure(figsize=(5 , 3))

# plt.subplot(n + 11)
plt.plot(times, re0, label='', color='k', linewidth=2)
plt.plot(times, re90, label='90 degree difference', 
         color='k', linewidth=2, linestyle='--')
plt.plot(times, re.max() * (stim/stim.max()), 
         color='purple', label='Stimulus', linewidth=3, alpha=0.4)
plt.legend(loc='lower left', frameon=False, ncol=2)
plt.xlim(0.2, 1)
plt.ylim(-5, 35)
plt.xlabel("Time (s)")
plt.ylabel("Rate (Hz)")
plt.axis('off')<jupyter_output><empty_output><jupyter_text>Stim only<jupyter_code>plt.figure(figsize=(5 , 3))
plt.plot(times, re.max() * (stim/stim.max()), 
         color='purple', label='Stimulus', linewidth=3, alpha=0.4)
plt.xlim(0.2, 1)
plt.ylim(-5, 35)
plt.axis('off')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.23389524382901866, 'fraction_numerical': 0.04425045153521975, 'mean_word_length': 4.17601246105919, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '305383', 'license': 'MIT', 'n_tokens_mistral': 1577, 'n_tokens_neox': 1461, 'n_words': 266, 'path': 'figs/fig3.ipynb', 'repo_name': 'voytekresearch/alphalogical', 'size': '3322'}