aim-spacy icon indicating copy to clipboard operation
aim-spacy copied to clipboard

Logging `textcat` breaks on score name `cats_score_desc` in base_logger.py

Open ceesroele opened this issue 2 years ago • 1 comments

For textcat the dictionary other_scores contains cats_score_desc which has a description, e.g. "F1 macro", rather than a loss value. When passed on to AIM through the call aim_run.track(loss_value, name=loss_name, context={'type':f'other_scores_{score_name}'}, epoch=epoch, step=step) the normalization of the loss value results in an error.

Solution: add a test for the score name ending in '_desc' in base_logger.py in the method aim_log_step.

if isinstance(other_scores, dict):
    for score_name, loss_value in other_scores.items():
        if not isinstance(loss_value, dict) and not score_name.endswith('_desc'):  # <-- extra condition for _desc
            aim_run.track(loss_value, name=loss_name, context={'type':f'other_scores_{score_name}'}, 
                                     epoch=epoch, step=step)

ceesroele avatar Nov 22 '22 08:11 ceesroele

@osoblanco any chance you could take a look at this and help solve it?

SGevorg avatar Dec 16 '22 13:12 SGevorg