Update model.py
Browse files
model.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import tensorflow as tf
|
| 2 |
from tensorflow.keras.layers import Dropout, Dense
|
| 3 |
from tensorflow.keras.applications import EfficientNetB7
|
| 4 |
-
from tensorflow.keras import Model
|
| 5 |
from tensorflow.keras.layers import Dropout, Dense, GlobalAveragePooling2D, Input
|
| 6 |
from tensorflow.keras.models import Model
|
| 7 |
|
|
@@ -25,9 +24,13 @@ def create_effnetb2_model(num_classes=15, seed=42):
|
|
| 25 |
x = base_model(inputs)
|
| 26 |
x = GlobalAveragePooling2D()(x)
|
| 27 |
x = Dropout(0.3)(x)
|
| 28 |
-
x = Dense(256, activation='relu')(x)
|
| 29 |
x = Dropout(0.3)(x)
|
| 30 |
-
x = Dense(128, activation='relu')(x)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Add a dense layer for classification
|
| 33 |
outputs = Dense(num_classes, activation='softmax')(x)
|
|
@@ -38,3 +41,4 @@ def create_effnetb2_model(num_classes=15, seed=42):
|
|
| 38 |
return model
|
| 39 |
|
| 40 |
|
|
|
|
|
|
| 1 |
import tensorflow as tf
|
| 2 |
from tensorflow.keras.layers import Dropout, Dense
|
| 3 |
from tensorflow.keras.applications import EfficientNetB7
|
|
|
|
| 4 |
from tensorflow.keras.layers import Dropout, Dense, GlobalAveragePooling2D, Input
|
| 5 |
from tensorflow.keras.models import Model
|
| 6 |
|
|
|
|
| 24 |
x = base_model(inputs)
|
| 25 |
x = GlobalAveragePooling2D()(x)
|
| 26 |
x = Dropout(0.3)(x)
|
| 27 |
+
x = Dense(256, activation='relu')(x)
|
| 28 |
x = Dropout(0.3)(x)
|
| 29 |
+
x = Dense(128, activation='relu')(x)
|
| 30 |
+
x = Dropout(0.3)(x)
|
| 31 |
+
x = Dense(64, activation='relu')(x) # Additional dense layer
|
| 32 |
+
x = Dropout(0.3)(x)
|
| 33 |
+
x = Dense(32, activation='relu')(x) # Additional dense layer
|
| 34 |
|
| 35 |
# Add a dense layer for classification
|
| 36 |
outputs = Dense(num_classes, activation='softmax')(x)
|
|
|
|
| 41 |
return model
|
| 42 |
|
| 43 |
|
| 44 |
+
|