<jupyter_start><jupyter_text>Introduction to the SBI expt packageThis notebook demonstrates how to use some of the tools developed for the SBI experiments package.  Installing the package and dependenciesBecause all we do here uses jax, it's super easy:<jupyter_code>!pip install --quiet git+https://github.com/astrodeepnet/sbi_experiments.git@basic_infra
%pylab inline
import jax
import jax.numpy as jnp<jupyter_output>Populating the interactive namespace from numpy and matplotlib<jupyter_text>Available toy distributionsHere we show you how to access the various distributions we are using for developing our models<jupyter_code>from sbiexpt import distributions<jupyter_output><empty_output><jupyter_text>Two moons<jupyter_code>dist = distributions.get_two_moons(sigma=0.1) # Instantiate distribution

# Create a visualisation grid
coords = jnp.stack(jnp.meshgrid(jnp.linspace(-1.5,2.5,128),
                                jnp.linspace(-1,1.5,128)),
                   axis=-1)
# Plot density
contourf(coords[...,0], coords[...,1], dist.prob(coords), 100);<jupyter_output><empty_output><jupyter_text>Swiss roll<jupyter_code>dist = distributions.get_swiss_roll(sigma=1) # Instantiate distribution

# Create a visualisation grid
coords = jnp.stack(jnp.meshgrid(jnp.linspace(-15,15,128),
                                jnp.linspace(-15,15,128)),
                   axis=-1)
# Plot density
contourf(coords[...,0], coords[...,1], dist.prob(coords), 100);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1063973063973064, 'fraction_numerical': 0.028282828282828285, 'mean_word_length': 4.5241635687732344, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 1, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '433946', 'license': 'MIT', 'n_tokens_mistral': 498, 'n_tokens_neox': 474, 'n_words': 110, 'path': 'notebooks/Introduction.ipynb', 'repo_name': 'aboucaud/sbi_experiments', 'size': '1485'}