<jupyter_start><jupyter_text>Load Data<jupyter_code>import sys
import os
import numpy as np
import matplotlib.pyplot as plt

package_dir = os.path.join(os.environ['HOME'], 'DataScience', 'quickdraw-gan')
data_dir = os.path.join(package_dir, 'data', 'raw')

# load numpy file
input_file = os.path.join(data_dir, 'cat.npy')
data = np.load(input_file)
data = np.reshape(data, newshape=(data.shape[0], 28, 28))
print('The dataset has %i drawings.' % data.shape[0])
n_rows = 3
n_cols = 10
entry = np.random.randint(0, data.shape[0], n_rows*n_cols)

fig, axes = plt.subplots(n_rows, n_cols, figsize=(22,5))
axes = axes.ravel()

for i, ax in enumerate(axes):
    ax.axis('off')
    ax.imshow(data[entry[i],:,:], cmap='gray_r')
import tensorflow as tf
from tensorflow.keras import layers
DIM = 32
model = tf.keras.Sequential()

model.add(layers.Conv2D(filters=DIM, kernel_size=(4, 4), strides=(2, 2), input_shape=(28, 28, 1), use_bias=False, padding='same'))
model.add(layers.LeakyReLU(alpha=0.2))

model.add(layers.Conv2D(filters=2*DIM, kernel_size=(4, 4), strides=(2, 2), use_bias=False, padding='same'))
model.add(layers.LeakyReLU(alpha=0.2))

model.add(layers.Conv2D(filters=4*DIM, kernel_size=(4, 4), strides=(2, 2), use_bias=False, padding='same'))
model.add(layers.LeakyReLU(alpha=0.2))

# 2048
model.add(layers.Flatten())
model.add(layers.Dense(units=1, use_bias=False))
model.output
AUX<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17854622441778406, 'fraction_numerical': 0.03458009880028229, 'mean_word_length': 6.706521739130435, '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': '495566', 'license': 'MIT', 'n_tokens_mistral': 601, 'n_tokens_neox': 564, 'n_words': 108, 'path': 'notebooks/Load Data.ipynb', 'repo_name': 'philipp-gaspar/quickdraw-gan', 'size': '1417'}