class_docstr: Plugin that manages the loss.tsv file output.
class_docstr_tok: ["Plugin","that","manages","the","loss.tsv","file","output","."]
docstr: Add the metric of a record to the current row.
docstr_tok: ["Add","the","metric","of","a","record","to","the","current","row","."]
code: def metric_recorded(self, record):
      """Add the metric of a record to the current row."""
      if record.name in self.headers and self.current_row is not None:
          if record.name == "learning_rate" and not record.is_scalar:
              # record is a list of scalars
              value = ",".join([f"{lr:.4f}" for lr in record.value])
          elif record.is_scalar and isinstance(record.value, int):
              value = str(record.value)
          else:
              assert record.is_scalar
  
              value = f"{record.value:.4f}"
  
          self.current_row[record.name] = value
  
file_path: flair/flair/trainers/plugins/loggers/loss_file.py
imports: from datetime import datetime
  from typing import Any, Dict, Optional, Tuple, Union
  from flair.trainers.plugins.base import TrainerPlugin
  from flair.trainers.plugins.metric_records import MetricName
  from flair.training_utils import init_output_file
label_desc: Use image node_id 4 for calling the LossFilePlugin obj's underlying member method code with example usage: obj.metric_recorded(record) without return types