Learner Utils¶
This section contains helper code for the Octopod learner pipelines for supporting multiple loss functions and metrics for individual tasks.
Metric Utils¶
-
octopod.learner_utils.metrics_utils.
multi_class_accuracy
(y_true, y_raw_preds)¶ Takes in raw outputs from Octopod task heads and outputs an accuracy metric and the processed predictions after a softmax as been applied
- Parameters
y_true (np.array) – Target labels for a specific task for the predicted samples in y_raw_preds
y_raw_preds (np.array) – predicted values for the validation set for a specific task
- Returns
acc (float) – Output of a sklearn accuracy score function
y_preds (np.array) – array of predicted values where a softmax has been applied
-
octopod.learner_utils.metrics_utils.
multi_label_accuracy
(y_true, y_raw_preds)¶ Takes in raw outputs from Octopod task heads and outputs an accuracy metric and the processed predictions after a sigmoid as been applied
- Parameters
y_true (np.array) – Target labels for a specific task for the predicted samples in y_raw_preds
y_raw_preds (np.array) – predicted values for the validation set for a specific task
- Returns
acc (float) – Output of a sklearn accuracy score function
y_preds (np.array) – array of predicted values where a sigmoid has been applied