<jupyter_start><jupyter_text>1. install packages for CUDA GPU - CUDA toolkit 10.2 and CuDNN v8.0.5- cuda toolkit: https://developer.nvidia.com/cuda-10.2-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal- cudnn: https://developer.nvidia.com/rdp/cudnn-archive- Follow: https://pub.towardsai.net/installing-pytorch-with-cuda-support-on-windows-10-a38b1134535e2. install pytorch 1.7.x (pytorch.org) with cuda 10.2 on Windows```pip install torch===1.7.1 torchvision===0.8.2 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html```<jupyter_code>import torch
torch.cuda.is_available()
import scipy.stats as stats

import pyro.distributions as dist
import numpy as np
import torch as th
import matplotlib.pyplot as plt
a, b = 5, 2
beta = dist.Beta(concentration1=a, concentration0=b)
beta.rsample()
eps = 1e-7
x = torch.linspace(0+eps, 1-eps, 100)  # beta is not defined at {0, 1}
logp = beta.log_prob(x)  
# logp, np.exp(logp)
plt.plot(x, np.exp(logp));
x = np.linspace(0,1,50)
plt.plot(x, stats.beta(a=a, b=b).pdf(x));
import pyro
import pyro.distributions as dist
from pyro.infer import NUTS, MCMC

def model(ntheta, inds):
    with pyro.plate('ntheta', ntheta):
        theta = pyro.sample('theta', dist.Beta(2,3))
        
    return theta[inds]
ntheta = 5
inds = np.random.randint(low=0, high=ntheta, size=10)
print(inds)
model(5, inds)<jupyter_output>[2 3 1 3 1 3 4 2 2 3]
{'fraction_non_alphanumeric': 0.1479413817166783, 'fraction_numerical': 0.05303558967201675, 'mean_word_length': 4.713147410358566, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '543577', 'license': 'MIT', 'n_tokens_mistral': 636, 'n_tokens_neox': 580, 'n_words': 128, 'path': 'with_pyro/00_0_install.ipynb', 'repo_name': 'yongduek/DBDA-python', 'size': '1433'}