composer
composer copied to clipboard
EarlyStopper cannot deal with complex Metrics
🚀 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.