<jupyter_start><jupyter_text>Beta=1<jupyter_code>%%time
model = MnistBetaVAE(beta=1)
trainer = Trainer(max_epochs=100, gradient_clip_val=1.0)
trainer.fit(model)
with torch.no_grad():
    digits = get_digit_samples()
    enc, *_ = model(digits)
    swp = torch.linspace(-4, 4, steps=10)
    recons = sweep_variable_across_samples(model, enc.clone(), 0, swp)
    plot_sweep_grid(digits.detach().numpy(), recons, swp)
with torch.no_grad():
    m, s = zeroth_mu_sigma(enc, model)
    print('m', m.min(), m.max(), m.mean())
    print('s', s.min(), s.max(), s.mean())
with torch.no_grad():
    for r1, r2 in zip(recons, recons[1:]):
        print((r1 == r2).all(), np.allclose(r1, r2))<jupyter_output>False False
False False
False False
False False
False False
False False
False False
False False
False False<jupyter_text>Beta=10<jupyter_code>%%time
model_b = MnistBetaVAE(beta=10)
trainer = Trainer(max_epochs=100, gradient_clip_val=1.0)
trainer.fit(model_b)
with torch.no_grad():
    digits = get_digit_samples()
    enc, *_ = model_b(digits)
    swp = torch.linspace(-4, 4, steps=10)
    recons = sweep_variable_across_samples(model_b, enc.clone(), 0, swp)
    plot_sweep_grid(digits.detach().numpy(), recons, swp)
with torch.no_grad():
    m, s = zeroth_mu_sigma(enc, model_b)
    print('m', m.min(), m.max(), m.mean())
    print('s', s.min(), s.max(), s.mean())
with torch.no_grad():
    for r1, r2 in zip(recons, recons[1:]):
        print((r1 == r2).all(), np.allclose(r1, r2))<jupyter_output>False False
False False
False False
False False
False False
False False
False False
False False
False False<jupyter_text>Beta=0.1<jupyter_code>%%time
model_c = MnistBetaVAE(beta=0.1)
trainer = Trainer(max_epochs=100, gradient_clip_val=1.0)
trainer.fit(model_c)
with torch.no_grad():
    digits = get_digit_samples()
    enc, *_ = model_c(digits)
    swp = torch.linspace(-4, 4, steps=10)
    recons = sweep_variable_across_samples(model_c, enc.clone(), 0, swp)
    plot_sweep_grid(digits.detach().numpy(), recons, swp)
with torch.no_grad():
    m, s = zeroth_mu_sigma(enc, model_c)
    print('m', m.min(), m.max(), m.mean())
    print('s', s.min(), s.max(), s.mean())
with torch.no_grad():
    for r1, r2 in zip(recons, recons[1:]):
        print((r1 == r2).all(), np.allclose(r1, r2))<jupyter_output>False False
False False
False False
False False
False False
False False
False False
False False
False False
{'fraction_non_alphanumeric': 0.16278101582014987, 'fraction_numerical': 0.0253955037468776, 'mean_word_length': 4.762589928057554, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '225614', 'license': 'MIT', 'n_tokens_mistral': 1000, 'n_tokens_neox': 973, 'n_words': 202, 'path': '6_GaussianBeta.ipynb', 'repo_name': 'johnstill/vae_experiments', 'size': '2402'}