composer icon indicating copy to clipboard operation
composer copied to clipboard

EarlyStopper cannot deal with complex Metrics

Open priba opened this issue 2 years ago • 1 comments
trafficstars

🚀 Feature Request

EarlyStopper and ThresholdStopper cannot deal with complex Metrics such as MAP.

See:

https://github.com/mosaicml/composer/blob/8d4dfaf017369bc0d27bc4f707e0fa709005c7b5/composer/callbacks/early_stopper.py#L122

https://github.com/mosaicml/composer/blob/8d4dfaf017369bc0d27bc4f707e0fa709005c7b5/composer/callbacks/threshold_stopper.py#L100

This line should only convert the metric to a tensor if it is a numeric value. For complex metrics, we should either rely on self.comp_func and some distance metric or allow some way to extract the desired value in self.monitor. Otherwise it will also crash here when checking the absolute distance.

https://github.com/mosaicml/composer/blob/8d4dfaf017369bc0d27bc4f707e0fa709005c7b5/composer/callbacks/early_stopper.py#L128

Motivation

Metrics for object detection come as a dictionary. See MAP.

priba avatar Aug 04 '23 11:08 priba