Skip to content

Commit

Permalink
Fix ordinal mode to only be enabled when there are ordinal targets to…
Browse files Browse the repository at this point in the history
… predict
  • Loading branch information
nathanpainchaud committed Nov 24, 2023
1 parent 21e29af commit b71816d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions didactic/tasks/cardiac_multimodal_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ def __init__(
accuracy, task="multiclass", num_classes=len(TABULAR_CAT_ATTR_LABELS[attr])
)
}
# Switch on ordinal mode if i) it's enabled, and ii) there are ordinal targets to predict
self.hparams.ordinal_mode = self.hparams.ordinal_mode and any(
attr in TabularAttribute.ordinal_attrs() for attr in self.predict_losses
)

# Self-supervised losses and metrics
self.contrastive_loss = None
Expand Down

0 comments on commit b71816d

Please sign in to comment.