<jupyter_start><jupyter_text>Square attack<jupyter_code>p = patch.Patch('block', proportion=0.02,
                input_shape=mnist.input_shape,
                dynamic_mask=False,
                dynamic_pattern=False)
objective = util.make_objective_class(0, mnist.num_classes)
patched = mnist.poison(objective, p, fraction=1.0)
plt.rcParams['figure.figsize'] = (3, 3)
plot.grid(patched.x_train, n=4, show=False)
save_fig('../report/square.png')
p = patch.Patch('sparse', proportion=0.01,
                input_shape=mnist.input_shape,
                dynamic_mask=False, dynamic_pattern=False)
objective = util.make_objective_class(0, mnist.num_classes)
patched = mnist.poison(objective, p, fraction=1.0)
plt.rcParams['figure.figsize'] = (3, 3)
plot.grid(patched.x_train, n=4, show=False)
save_fig('../report/sparse.png')<jupyter_output><empty_output><jupyter_text>Moving square<jupyter_code>p = patch.Patch('block', proportion=0.02,
                input_shape=mnist.input_shape,
                dynamic_mask=True,
                dynamic_pattern=False)
objective = util.make_objective_class(0, mnist.num_classes)
patched = mnist.poison(objective, p, fraction=1.0)
plt.rcParams['figure.figsize'] = (3, 3)
plot.grid(patched.x_train, n=4, show=False)
save_fig('../report/moving-square.png')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1437216338880484, 'fraction_numerical': 0.02042360060514372, 'mean_word_length': 4.292, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '17440', 'license': 'Apache-2.0', 'n_tokens_mistral': 501, 'n_tokens_neox': 481, 'n_words': 61, 'path': 'experiments/report-figures.ipynb', 'repo_name': 'edublancas/trojan-defender', 'size': '1322'}