class_docstr: Plugin that manages the loss.tsv file output.
class_docstr_tok: ["Plugin","that","manages","the","loss.tsv","file","output","."]
docstr: This prints all relevant metrics.
docstr_tok: ["This","prints","all","relevant","metrics","."]
code: def after_evaluation(self, epoch, **kw):
      """This prints all relevant metrics."""
      if self.loss_txt is not None:
          self.current_row[
              MetricName("timestamp")
          ] = f"{datetime.now():%H:%M:%S}"
  
          # output log file
          with open(self.loss_txt, "a") as f:
              # remove columns where no value was found on the first epoch (could be != 1 if training was resumed)
              if epoch == self.first_epoch:
                  for k in list(self.headers.keys()):
                      if k not in self.current_row:
                          del self.headers[k]
  
              # make headers on epoch 1
              if epoch == 1:
                  # write header
                  f.write("\t".join(self.headers.values()) + "\n")
  
              for col in self.headers:
                  assert col in self.current_row, (
                      str(col) + "   " + str(self.current_row.keys())
                  )
  
              assert all(
                  col in self.current_row for col in self.headers
              )
  
              f.write(
                  "\t".join(
                      [
                          str(self.current_row[col])
                          for col in self.headers
                      ]
                  )
                  + "\n"
              )
  
          self.current_row = {}
  
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 5 for calling the LossFilePlugin obj's underlying member method code with example usage: obj.after_evaluation(epoch) without return types