AverageMeter and Metric Reduction Clarification
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- jupyter-notebook, python, pytorch
- Ambito
- machine-learning
Direzione di ricerca
Inizia da 3d_segmentation/swin_unetr_brats21_segmentation_3d.ipynb, esaminando l’implementazione di AverageMeter, l’aggregazione di acc_func e la chiamata a run_acc.update. Esegui il notebook o la riproduzione indicata e verifica in che modo le combinazioni di predizioni e valori ground truth NaN e non-NaN influiscono sulla media riportata; il lavoro è completato quando il comportamento previsto per i falsi positivi e le classi mancanti è chiarito e riflesso in modo coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am seeking clarification on the AverageMeter and metric reduction implementations in 3d_segmentation/swin_unetr_brats21_segmentation_3d.ipynb.
For instance, here is the AverageMeter implementation provided in the brats swinunetr tutorial:
class AverageMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
self.sum += val * n
self.count += n
self.avg = np.where(self.count > 0, self.sum / self.count, self.sum)
It's similar to the ImageNet implementation apart from the last line.
ImageNet's last line: self.avg = self.sum / self.count
The reason why I think this could be problematic is because the tutorial does the following:
acc_func(y_pred=val_output_convert, y=val_labels_list)
acc, not_nans = acc_func.aggregate()
run_acc.update(acc.cpu().numpy(), n=not_nans.cpu().numpy())
This implies that anytime the model has a nan prediction and the ground truth is NOT NAN (or vice versa), the resulting dice coefficient is NOT penalized as though the prediction has a dice coefficient of zero.
For instance, let's assume the ground truth is has pixels in it, but the model predicts nothing for one class, resulting in these dice values: [0.0000, 0.8775, 0.1213]
The way that AverageMeter is currently used might simply ignore the 0 dice value in the first class if DiceMetric returned nan for the corresponding class.
However, NaNs are caused by the ground truth being NaN. What happens when the ground truth is NaN AND the predicted is not NaN, because that is also not desirable (i.e. false positive)?
Edit: please see my next comment for further clarification.
To Reproduce
Just run the notebook or use the AverageMeter implementation within your own code.
Expected behavior
Would it be possible to refactor the aggregation/average meter to yield zero if the ground truth is NaN and the predicted is NOT NaN?
- Lingua principale
- Jupyter Notebook
- Stelle
- 2.6k
- Fork
- 805
- Merge medio
- 6g 17h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Project-MONAI/tutorials
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
Project-MONAI/tutorials#2069 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Project-MONAI/tutorials#1704 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Project-MONAI/tutorials#2080 ·
-
Rehost CONSepForse già presa @vikashg l’ha presa 11 giorni fa. Aperta
Project-MONAI/tutorials#2079 · 1 commento · 2 assegnatari ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
Project-MONAI/tutorials#2071 ·
Tutte le issue di Project-MONAI/tutorials
Issue simili
-
area:ai-suggestions bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
uttrflow/uttrflow-swift#5115 ·
I maintainer di solito rispondono entro 1 giorno
-
Zero-token evaluations are treated as missing cost in selectionForse già presa @sylvesterkaczmarek l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google-research/rrsi#6 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100