<jupyter_start><jupyter_text>EYELEE v1.0 by <NAME><jupyter_code>import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, Activation
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
resnet50_model = tf.keras.applications.ResNet50()
x = resnet50_model.layers[-2].output           
predictions = Dense(2, activation='softmax')(x) 
eyelee_model = Model(inputs=resnet50_model.input, outputs=predictions)
for layer in eyelee_model.layers [:-1]:
  layer.trainable = False
eyelee_model.compile(Adam(lr=0.0001), loss='categorical_crossentropy', metrics=['accuracy'])
train_path= '../input/rockpaper/train'
valid_path= '../input/rockpaper/valid'
test_path= '../input/rockpaper/test'
from tensorflow.keras.preprocessing.image import ImageDataGenerator

train_batches = ImageDataGenerator(preprocessing_function=tf.keras.applications.resnet.preprocess_input).flow_from_directory(train_path, target_size=(224, 224), classes=['rock', 'paper'], batch_size=500)
valid_batches = ImageDataGenerator(preprocessing_function=tf.keras.applications.resnet.preprocess_input).flow_from_directory(valid_path, target_size=(224, 224), classes=['rock', 'paper'], batch_size=20)
test_batches = ImageDataGenerator(preprocessing_function=tf.keras.applications.resnet.preprocess_input).flow_from_directory(test_path, target_size=(224, 224), classes=['rock', 'paper'], batch_size=10)<jupyter_output><empty_output><jupyter_text>III ] TRAIN AND SAVE THE MODEL<jupyter_code>eyelee_model.compile(Adam(lr=0.0001), loss='categorical_crossentropy', metrics=['accuracy'])
eyelee_model.fit_generator(train_batches, steps_per_epoch=4, validation_data=valid_batches, validation_steps=4, epochs=80, verbose=2)
# Save to the model to .h5
eyelee_model.save('eyelee_v1.h5')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12862414338429098, 'fraction_numerical': 0.02952029520295203, 'mean_word_length': 9.371584699453551, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '525617', 'license': 'MIT', 'n_tokens_mistral': 678, 'n_tokens_neox': 637, 'n_words': 96, 'path': 'roboteur-resnet50-model.ipynb', 'repo_name': 'roboteur/computer-vision-part-02', 'size': '1903'}