class_docstr: Generic logger callback for dumping experiment data. Can be extended for more utility.
class_docstr_tok: ["Generic","logger","callback","for","dumping","experiment","data",".","Can","be","extended","for","more","utility","."]
code: def on_train_end(self, logs=None):
      REJECT_KEYS = {"has_validation_data"}
      row_dict = self.row_dict
  
      class CustomDialect(csv.excel):
          delimiter = self.sep
  
      self.keys = self.keys
      temp_file = NamedTemporaryFile(delete=False, mode="w")
      with open(self.file, "r") as csv_file, temp_file:
          reader = csv.DictReader(
              csv_file,
              fieldnames=["model"]
              + [k for k in self.keys if k not in REJECT_KEYS],
              dialect=CustomDialect,
          )
          writer = csv.DictWriter(
              temp_file,
              fieldnames=["model"]
              + [k for k in self.keys if k not in REJECT_KEYS],
              dialect=CustomDialect,
          )
          for row_idx, row in enumerate(reader):
              if row_idx == 0:
                  # re-write header with on_train_end's metrics
                  pass
              if row["model"] == self.row_dict["model"]:
                  writer.writerow(row_dict)
              else:
                  writer.writerow(row)
      shutil.move(temp_file.name, self.file)
  
file_path: pywick/pywick/callbacks/ExperimentLogger.py
imports: import csv
  import os
  import shutil
  from collections import OrderedDict
  from tempfile import NamedTemporaryFile
  from .None import Callback
label_desc: Use image node_id 3 for calling the ExperimentLogger obj's underlying member method code with example usage: obj.on_train_end(logs) without return types