# Run this cell after your experiment. It exports drawings, not executable code. ENTRY_NAME = "My doodler" # Give your entry a recognizable name. WHAT_CHANGED = "" # One or two sentences about your experiment. import json from pathlib import Path submission_drawings = [] submission_categories = ['apple', 'cat', 'fish', 'flower'] for submission_seed in [101, 202, 303, 404]: submission_batch = sample(experiment, KIND, list(range(4)), seed=submission_seed, temperature=TEMPERATURE, sampling_steps=SAMPLING_STEPS) submission_pixels = (submission_batch.detach().cpu().numpy()[:, 0] >= 0.5) for category, pixels in zip(submission_categories, submission_pixels): submission_drawings.append({'category': category, 'seed': submission_seed, 'pixels': ''.join('1' if p else '0' for p in pixels.flat)}) submission = {'schema': 'rogues-classroom-v1', 'width': 32, 'height': 32, 'polarity': '1=ink', 'title': ENTRY_NAME, 'model': KIND, 'notes': WHAT_CHANGED, 'drawings': submission_drawings, 'sampling': {'temperature': TEMPERATURE, 'steps': SAMPLING_STEPS, 'threshold': 0.5}} submission_path = Path('classroom-submission.json') submission_path.write_text(json.dumps(submission)) print('Ready: classroom-submission.json — 16 drawings, four per category.') print('Sign in and upload at https://competition.roguesgallery.io/classroom/') try: from google.colab import files files.download(str(submission_path)) except ImportError: from IPython.display import FileLink, display display(FileLink(str(submission_path)))