Skip to content

Commit

Permalink
fix call to calc_uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiaanr committed Aug 2, 2024
1 parent 114ef8d commit 11512f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ptype/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
CSVLogger,
EarlyStopping,
)
from mlguess.keras.models import calc_prob_uncertainty
from tensorflow.python.keras.callbacks import ReduceLROnPlateau
from sklearn.metrics import precision_recall_fscore_support, roc_auc_score
from hagelslag.evaluation.ProbabilityMetrics import DistributedROC
Expand Down Expand Up @@ -68,7 +67,7 @@ def __init__(self, x, y, name="val", n_bins = 10, use_uncertainty = False, **kwa
def on_epoch_end(self, epoch, logs={}):
pred_probs = np.asarray(self.model.predict(self.x))
if self.use_uncertainty:
pred_probs, _, _, _ = calc_prob_uncertainty(pred_probs)
pred_probs, _, _, _ = self.model.calc_uncertainty(pred_probs)
pred_probs = pred_probs.numpy()
logs[f"{self.name}_csi"] = self.mean_csi(pred_probs)
true_labels = np.argmax(self.y, 1)
Expand Down

0 comments on commit 11512f9

Please sign in to comment.