espnet2.train.reporter.wandb_get_prefix
Less than 1 minute
espnet2.train.reporter.wandb_get_prefix
espnet2.train.reporter.wandb_get_prefix(key: str)
Get the prefix for logging keys based on their category.
This function determines the appropriate prefix for a given key based on its category, which can be ‘valid’, ‘train’, ‘attn’, or others. The prefix helps in organizing the logged data in a structured way.
- Parameters:key (str) – The key for which to determine the prefix.
- Returns: The prefix corresponding to the provided key.
- Return type: str
Examples
>>> wandb_get_prefix("valid_loss")
'valid/'
>>> wandb_get_prefix("train_accuracy")
'train/'
>>> wandb_get_prefix("attn_weights")
'attn/'
>>> wandb_get_prefix("other_metric")
'metrics/'