<jupyter_start><jupyter_text>Args<jupyter_code>class args:
    save_dir = "weights/"
    debug = True
    
    # model
    routings = 1
    
    # hp
    batch_size = 32
    lr = 0.001
    lr_decay = 1.0
    lam_recon = 0.392
    
    # training
    epochs = 3
    shift_fraction = 0.1
    digit = 5<jupyter_output><empty_output><jupyter_text>Load data<jupyter_code>(x_train, y_train), (x_test, y_test) = capsulenet.load_mnist()<jupyter_output><empty_output><jupyter_text>Define model<jupyter_code>model, eval_model, manipulate_model = capsulenet.CapsNet(input_shape=x_train.shape[1:],
                                                  n_class=len(np.unique(np.argmax(y_train, 1))),
                                                  routings=args.routings)<jupyter_output><empty_output><jupyter_text>Training<jupyter_code>capsulenet.train(model=model, data=((x_train, y_train), (x_test, y_test)), args=args)
capsulenet.test(eval_model, data=(x_test, y_test), args=args)<jupyter_output>------------------------------Begin: test------------------------------
Test acc: 0.9784

Reconstructed images are saved to weights//real_and_recon.png
------------------------------End: test------------------------------
{'fraction_non_alphanumeric': 0.20149253731343283, 'fraction_numerical': 0.01990049751243781, 'mean_word_length': 2.193121693121693, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '668001', 'license': 'MIT', 'n_tokens_mistral': 431, 'n_tokens_neox': 403, 'n_words': 58, 'path': 'run.ipynb', 'repo_name': 'ghetthub/capsnet', 'size': '1206'}