class_docstr: TensorBoard callback which writes metrics as text to the given log directory. Requires the TensorboardX library
  for python.
  
  Example: ::
  
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import TensorBoardText
      >>> import datetime
      >>> current_time = datetime.now().strftime('%b%d_%H-%M-%S')
      # Callback that will log to tensorboard under "(model name)_(current time)"
      >>> tb = TensorBoardText(comment=current_time)
      # Trial that will run the callback and log accuracy and loss metrics as text to tensorboard
      >>> t = Trial(None, callbacks=[tb], metrics=['acc', 'loss'])
  
  Args:
      log_dir (str): The tensorboard log path for output
      write_epoch_metrics (bool): If True, metrics from the end of the epoch will be written
      log_trial_summary (bool): If True logs a string summary of the Trial
      batch_step_size (int): The step size to use when writing batch metrics, make this larger to reduce latency
      comment (str): Descriptive comment to append to path
      visdom (bool): If true, log to visdom instead of tensorboard
      visdom_params (VisdomParams): Visdom parameter settings object, uses default if None
  
  State Requirements:
      - :attr:`torchbearer.state.SELF`: The :attr:`torchbearer.Trial` running this callback
      - :attr:`torchbearer.state.EPOCH`: State should have the current epoch stored
      - :attr:`torchbearer.state.BATCH`: State should have the current batch number stored if logging batch metrics
      - :attr:`torchbearer.state.METRICS`: State should have a dictionary of metrics stored
class_docstr_tok: ["TensorBoard","callback","which","writes","metrics","as","text","to","the","given","log","directory",".","Requires","the","TensorboardX","library","for","python",".","Example",":",":",":",">",">",">","from","torchbearer","import","Trial",">",">",">","from","torchbearer.callbacks","import","TensorBoardText",">",">",">","import","datetime",">",">",">","current_time","=","datetime.now","(",")",".strftime","(","'","%","b","%","d_","%","H-","%","M-","%","S","'",")","#","Callback","that","will","log","to","tensorboard","under","``","(","model","name",")","_","(","current","time",")","''",">",">",">","tb","=","TensorBoardText","(","comment=current_time",")","#","Trial","that","will","run","the","callback","and","log","accuracy","and","loss","metrics","as","text","to","tensorboard",">",">",">","t","=","Trial","(","None",",","callbacks=","[","tb","]",",","metrics=","[","'acc","'",",","'loss","'","]",")","Args",":","log_dir","(","str",")",":","The","tensorboard","log","path","for","output","write_epoch_metrics","(","bool",")",":","If","True",",","metrics","from","the","end","of","the","epoch","will","be","written","log_trial_summary","(","bool",")",":","If","True","logs","a","string","summary","of","the","Trial","batch_step_size","(","int",")",":","The","step","size","to","use","when","writing","batch","metrics",",","make","this","larger","to","reduce","latency","comment","(","str",")",":","Descriptive","comment","to","append","to","path","visdom","(","bool",")",":","If","true",",","log","to","visdom","instead","of","tensorboard","visdom_params","(","VisdomParams",")",":","Visdom","parameter","settings","object",",","uses","default","if","None","State","Requirements",":","-",":","attr",":","`","torchbearer.state.SELF","`",":","The",":","attr",":","`","torchbearer.Trial","`","running","this","callback","-",":","attr",":","`","torchbearer.state.EPOCH","`",":","State","should","have","the","current","epoch","stored","-",":","attr",":","`","torchbearer.state.BATCH","`",":","State","should","have","the","current","batch","number","stored","if","logging","batch","metrics","-",":","attr",":","`","torchbearer.state.METRICS","`",":","State","should","have","a","dictionary","of","metrics","stored"]
code: def on_start_epoch(self, state):
      if self.write_batch_metrics:
          if self.visdom:
              self.batch_log_dir = os.path.join(self.log_dir, "epoch/")
              batch_params = (
                  self.visdom_params
                  if self.visdom_params is not None
                  else VisdomParams()
              )
              batch_params.ENV = batch_params.ENV + "-batch"
              self.batch_writer = self.get_writer(
                  self.batch_log_dir,
                  visdom=self.visdom,
                  visdom_params=batch_params,
              )
          else:
              self.batch_log_dir = os.path.join(
                  self.log_dir, "epoch-" + str(state[torchbearer.EPOCH])
              )
              self.batch_writer = self.get_writer(self.batch_log_dir)
  
imports: import copy
  import os
  import warnings
  import torch
  import torch.nn.functional
  import torchbearer
  from torchbearer.callbacks import Callback
label_desc: Use image node_id 4 for calling the TensorBoardText obj's underlying member method code with example usage: obj.on_start_epoch(state) without return types