Parcourir la source

Add of models folder with metrics

Jérôme BUISINE il y a 4 ans
Parent
commit
b509851b5d
4 fichiers modifiés avec 11 ajouts et 2 suppressions
  1. 1 1
      cnn_models.py
  2. 0 0
      models/__init__.py
  3. 9 0
      models/metrics.py
  4. 1 1
      modules

+ 1 - 1
cnn_models.py

@@ -14,7 +14,7 @@ import tensorflow as tf
 sys.path.insert(0, '') # trick to enable import of main folder module
 sys.path.insert(0, '') # trick to enable import of main folder module
 
 
 import custom_config as cfg
 import custom_config as cfg
-from modules.models import metrics
+from models import metrics
 
 
 def generate_model_2D(_input_shape):
 def generate_model_2D(_input_shape):
 
 

+ 0 - 0
models/__init__.py


+ 9 - 0
models/metrics.py

@@ -0,0 +1,9 @@
+# model imports
+from keras import backend as K
+import tensorflow as tf
+
+def auc(y_true, y_pred):
+    auc = tf.metrics.auc(y_true, y_pred)[1]
+    K.get_session().run(tf.local_variables_initializer())
+    
+    return auc

+ 1 - 1
modules

@@ -1 +1 @@
-Subproject commit 4d35e5fbc4cb7145bf524a609d9500da4a4433df
+Subproject commit 917b396477d60a96dbc233554b4324cf7d9ae8c4