<jupyter_start><jupyter_text>EvaluationThis notebook shows visual examples generated by the model, and compares those to their reference.<jupyter_code>import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
from model import TransposeCNN, parse_images
model = TransposeCNN()
img_names = [f"sample_{i}" for i in range(1, 10001)]
features, values = parse_images(img_names)
fig=plt.figure(figsize=(8, 8))
for i in range(4*4):
    ax = plt.subplot(4, 4, i+1)
    ax.set_aspect('equal')
    plt.imshow(values[200+i])
    plt.axis('off')
plt.subplots_adjust(wspace=0.1, hspace=0.1)
plt.suptitle('Real images')
plt.tight_layout()
plt.savefig('images/sample_real.png', bbox_inches='tight')
images = model(features[200:216])
fig=plt.figure(figsize=(8, 8))
for i in range(4*4):
    ax = plt.subplot(4, 4, i+1)
    ax.set_aspect('equal')
    plt.imshow(images[i])
    plt.axis('off')
plt.subplots_adjust(wspace=0.1, hspace=0.1)
plt.suptitle('Generated images')
plt.tight_layout()
plt.savefig('images/sample_generated.png', bbox_inches='tight')
plt.figure(figsize=(16, 8))
plt.subplot(1,2,1)
plt.imshow(plt.imread('images/sample_real.png'))
plt.axis('off')
plt.subplot(1,2,2)
plt.imshow(plt.imread('images/sample_generated.png'))
plt.axis('off')
plt.tight_layout()
plt.savefig('images/sample_combined.png', bbox_inches='tight')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1634756995581738, 'fraction_numerical': 0.033873343151693665, 'mean_word_length': 6.721590909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '611021', 'license': 'MIT', 'n_tokens_mistral': 570, 'n_tokens_neox': 523, 'n_words': 92, 'path': 'evaluation.ipynb', 'repo_name': 'RubenPants/BlenderCNN', 'size': '1358'}