Skip to content

Commit

Permalink
metrics manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanKuchin committed Nov 25, 2024
1 parent c6484b6 commit 08bdc41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pancreas_ai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

LOSS_FUNCTION = "dice" # "dice" or "scce"

MONITOR_METRIC = "val_custom_f1"
MONITOR_METRIC = "val_f1"
MONITOR_MODE = "max"

MODEL_CHECKPOINT = "checkpoints/weights.keras"
Expand Down
7 changes: 5 additions & 2 deletions src/pancreas_ai/tools/craft_network/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def reset_states(self):
self.m.assign(0)

def update_state(self, y_true, y_pred, sample_weight=None):
print("y_true:", y_true.numpy(), "\t y_pred:", y_pred)
print("y_true:", y_true, "\t y_pred:", y_pred)

def result(self):
return self.m
Expand All @@ -24,7 +24,10 @@ def __classification_metrics(config: dict) -> list:
tf.keras.metrics.Precision(name="precision"),
tf.keras.metrics.Recall(name="recall"),
tf.keras.metrics.F1Score(name="f1"),
binary_metrics.Binary_MCC(name = "custom_mcc")
tf.keras.metrics.TruePositives(name="tp"),
tf.keras.metrics.TrueNegatives(name="tn"),
binary_metrics.Binary_MCC(name = "custom_mcc"),
# PrintMetricsInput(),
# binary_metrics.precision,
# binary_metrics.recall,
# binary_metrics.f1,
Expand Down

0 comments on commit 08bdc41

Please sign in to comment.