<jupyter_start><jupyter_text>Criando a rede 2<jupyter_code>from tensorflow.image import resize
X_train_2 = np.expand_dims(train_images, axis=-1)
X_train_2 = np.repeat(X_train_2, 1, axis=-1)
X_train_resize_2 = resize(X_train_2, [28,28])

X_test_2 = np.expand_dims(test_images, axis=-1)
X_test_2 = np.repeat(X_test_2, 1, axis=-1)
X_test_resize_2 = resize(X_test_2, [28,28])
print(np.shape(X_test_resize_2))

train_Y_one_hot = tf.keras.utils.to_categorical(train_labels)
test_Y_one_hot = tf.keras.utils.to_categorical(test_labels)
classificador = models.Sequential()
classificador.add(Flatten(input_shape=(28,28,1)))
classificador.add(Dense(units=28*28, use_bias=True, activation= 'relu'))
classificador.add(Dense(units=1024, activation= 'relu'))
classificador.add(Dense(units=2048, activation= 'relu'))
classificador.add(Dense(units=2048, activation= 'relu'))
classificador.add(Dense(units=10, activation= 'softmax'))
classificador.compile(optimizer='adam', loss=losses.categorical_crossentropy, metrics=['accuracy'])
print(classificador.summary())
history = classificador.fit(X_train_resize_2, train_Y_one_hot, batch_size=256, epochs=1, validation_data=(X_test_resize_2, test_Y_one_hot))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14226973684210525, 'fraction_numerical': 0.04523026315789474, 'mean_word_length': 11.049504950495049, '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': '576667', 'license': 'MIT', 'n_tokens_mistral': 511, 'n_tokens_neox': 486, 'n_words': 62, 'path': 'BEDL-TP_M01.ipynb', 'repo_name': 'CarlucioSts/Machine-Learning', 'size': '1216'}