Spaces:
Sleeping
Sleeping
Commit
·
26b08fd
1
Parent(s):
aee66d8
Update utils.py
Browse files
utils.py
CHANGED
@@ -25,26 +25,18 @@ def preprocess(image):
|
|
25 |
return image
|
26 |
|
27 |
def model_arc():
|
28 |
-
model = Sequential(
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
model.add(Flatten())
|
42 |
-
|
43 |
-
model.add(Dense(64, activation='relu'))
|
44 |
-
model.add(Dropout(0.2))
|
45 |
-
model.add(Dense(32, activation='relu'))
|
46 |
-
|
47 |
-
model.add(Dropout(0.2))
|
48 |
-
model.add(Dense(6, activation='softmax'))
|
49 |
|
50 |
return model
|
|
|
25 |
return image
|
26 |
|
27 |
def model_arc():
|
28 |
+
model = tf.keras.Sequential([
|
29 |
+
data_augmentation,
|
30 |
+
base_model,
|
31 |
+
tf.keras.layers.GlobalAveragePooling2D(),
|
32 |
+
tf.keras.layers.Dense(6, activation='softmax')
|
33 |
+
])
|
34 |
+
|
35 |
+
learning_rate = 0.00001
|
36 |
+
model.compile(
|
37 |
+
loss='sparse_categorical_crossentropy',
|
38 |
+
optimizer=tf.keras.optimizers.Adam(learning_rate),
|
39 |
+
metrics=['accuracy']
|
40 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
return model
|