<jupyter_start><jupyter_text><jupyter_code>from keras.datasets import mnist
(train_images,train_lables),(test_images,test_lables)=mnist.load_data()
len(train_images)
len(train_lables)
len(test_images)
len(test_lables)
train_images.shape
test_images.shape
from keras import models
from keras import layers
network=models.Sequential()
network.add(layers.Dense(512,activation='relu',input_shape=(28*28,)))
network.add(layers.Dense(10,activation='softmax'))
network.compile(optimizer='rmsprop',
                loss='categorical_crossentropy',
                metrics=['accuracy']

)
train_images=train_images.reshape((60000,28*28))
train_images=train_images.astype('float32')/255
test_images=test_images.reshape((10000,28*28))
test_images=test_images.astype('float32')/255
from keras.utils import to_categorical
train_lables=to_categorical(train_lables)
test_lables=to_categorical(test_lables)
network.fit(train_images,train_lables,epochs=5,batch_size=128)
test_loss,test_accu=network.evaluate(test_images,test_lables)
test_loss,test_accu<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12206572769953052, 'fraction_numerical': 0.038497652582159626, 'mean_word_length': 10.714285714285714, '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': '295690', 'license': 'MIT', 'n_tokens_mistral': 416, 'n_tokens_neox': 386, 'n_words': 38, 'path': 'hello_machine_learning.ipynb', 'repo_name': 'Ankitmauryavector/dog-project', 'size': '1065'}