Module mimir.attacks.attack_utils

Utility functions for attacks

Functions

def apply_extracted_fills(masked_texts: List[str], extracted_fills)
def count_masks(texts)
def f1_score(prediction, ground_truth)

Compute F1 score for given prediction and ground truth.

def filter_out_nan(x)
def get_auc_from_thresholds(preds_member, preds_nonmember, thresholds)

Compute FPRs and TPRs corresponding to given thresholds

def get_precision_recall_metrics(preds_member, preds_nonmember)
def get_roc_metrics(preds_member, preds_nonmember, perform_bootstrap: bool = False, return_thresholds: bool = False)