<jupyter_start><jupyter_text>A notebook for testing and developing the function efficient_cone_and_projected_interval_sample<jupyter_code>%load_ext autoreload
%autoreload 2
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
import torch


from probabilistic_model_synthesis.simulation import efficient_cone_and_projected_interval_sample<jupyter_output><empty_output><jupyter_text>Parameters go here<jupyter_code>ang_range = [1*np.pi + 2*np.pi, 1.7*np.pi + 2*np.pi]
w = torch.randn(10000)
interval = [4, 5]
small_std = .01
big_std = 1.0<jupyter_output><empty_output><jupyter_text>Generate random data<jupyter_code>n_vars = len(w)
locs = torch.rand([n_vars,2])
smps = efficient_cone_and_projected_interval_sample(n_smps=100, locs=locs, ctr = torch.tensor([.5, .5]),
                                                    ang_range=ang_range, w=w, interval=interval,
                                                    big_std=big_std, small_std=small_std, 
                                                    device=torch.device('cuda'))<jupyter_output><empty_output><jupyter_text>View results<jupyter_code>smps = smps.cpu().numpy()
smp_stds = np.std(smps,0)

min_smp_std = np.min(smp_stds)
max_smp_std = np.max(smp_stds)
smp_std_span = max_smp_std - min_smp_std

smp_stds_scaled = (smp_stds - min_smp_std)/smp_std_span
plot_std_clrs = cm.viridis(smp_stds_scaled)

plt.figure(figsize=(7, 7))
ax = plt.subplot(1,1,1)
ax.scatter(locs[:,0], locs[:,1], marker='.', color=plot_std_clrs)

plt.hist(smp_stds_scaled)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11161000641436819, 'fraction_numerical': 0.019884541372674792, 'mean_word_length': 4.2, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '279137', 'license': 'MIT', 'n_tokens_mistral': 613, 'n_tokens_neox': 591, 'n_words': 87, 'path': 'development/efficient_cone_and_projected_interval_sample_development.ipynb', 'repo_name': 'wbishopJanelia/probabilistic_model_synthesis', 'size': '1559'}