-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmasterclass1.py
More file actions
29 lines (15 loc) · 807 Bytes
/
Copy pathmasterclass1.py
File metadata and controls
29 lines (15 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pandas as pd
pd.__version__
import keras
from keras.layers import Flatten, Dense
from keras.models import Sequential
model = Sequential([Flatten(input_shape=(28,28)), Dense(128, activation='relu'), Dense(10, activation='softmax')])
fashion_mnist = keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
class_names = ['t-shirt','trouser','pullover','dress','coat','sandal','shirt','sneaker','bag','ankle_boot']
train_images = train_images/255
test_imags = test_images/255
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
model.fit(train_images, train_labels, epochs=10)
test_loss, test_acc = model.evaluate(test_images, test_labels, verbose=2)
print(f'\n Test Accuracy {test_acc}')