Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,11 @@ class FixedDropout(tf.keras.layers.Layer):
|
|
17 |
def call(self, inputs, training=None):
|
18 |
if training is None:
|
19 |
training = K.learning_phase()
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
|
22 |
def get_config(self):
|
23 |
config = super(FixedDropout, self).get_config()
|
@@ -26,6 +30,7 @@ class FixedDropout(tf.keras.layers.Layer):
|
|
26 |
config['seed'] = self.seed # Serialize the seed argument
|
27 |
return config
|
28 |
|
|
|
29 |
class ImageClassifierApp:
|
30 |
def __init__(self, model_path):
|
31 |
self.model_path = model_path
|
|
|
17 |
def call(self, inputs, training=None):
|
18 |
if training is None:
|
19 |
training = K.learning_phase()
|
20 |
+
|
21 |
+
if training:
|
22 |
+
return K.in_train_phase(K.dropout(inputs, self.rate, noise_shape=self.noise_shape, seed=self.seed), inputs, training=training)
|
23 |
+
else:
|
24 |
+
return inputs
|
25 |
|
26 |
def get_config(self):
|
27 |
config = super(FixedDropout, self).get_config()
|
|
|
30 |
config['seed'] = self.seed # Serialize the seed argument
|
31 |
return config
|
32 |
|
33 |
+
|
34 |
class ImageClassifierApp:
|
35 |
def __init__(self, model_path):
|
36 |
self.model_path = model_path
|