<jupyter_start><jupyter_text>CIFAR10 dataset<jupyter_code>from tensorflow.keras.datasets import cifar10
# Load Data
(train_images, train_labels), (test_images, test_labels) = cifar10.load_data()
train_labels = to_categorical(train_labels)
test_labels = to_categorical(test_labels)
train_images, test_images = train_images / 255.0, test_images / 255.0

# Model 
model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(MaxPooling2D((2, 2)))
model.add(Dropout(0.2))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(Dropout(0.3))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(10, activation='softmax'))

model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['acc'])
model.summary()
# Train model 
history = model.fit(train_images, train_labels, batch_size=256, epochs=10, verbose=1, validation_split = 0.1).history
plots(range(1,11), history)
acc = model.evaluate(test_images,test_labels)
print(f' Test Score [Accuracy]: {acc[1]*100:.2f}%')<jupyter_output>313/313 [==============================] - 2s 7ms/step - loss: 0.7469 - acc: 0.7424
 Test Score [Accuracy]: 74.24%
{'fraction_non_alphanumeric': 0.19476520400307928, 'fraction_numerical': 0.07005388760585066, 'mean_word_length': 7.9655172413793105, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '560318', 'license': 'MIT', 'n_tokens_mistral': 550, 'n_tokens_neox': 491, 'n_words': 87, 'path': 'lec3_CNN/lec3_cnn_cifar10.ipynb', 'repo_name': 'ChihabEddine98/DL_course', 'size': '1299'}