Skip to main content

utils.writer.tensorboard

Tensorboard writer module.

Tensorboard Objects#

class Tensorboard(Writer)

This class implements a wrapper on Tensorboard's SummaryWriter for logging stats to Tensorboard. Please look here for detailed information on each function: https://pytorch.org/docs/stable/tensorboard.html# Visit this blog for more examples on logging stats to Tensorboard: https://krishansubudhi.github.io/deeplearning/2020/03/24/tensorboard-pytorch.html

log_scalar#

def log_scalar(k, v, step)

Log metric to Tensorboard graph.

log_multi#

def log_multi(k, v, step)

Log multiple metrics in the same Tensorboard graph.

log_model#

def log_model(flat_weights, flat_grads, step)

Log model weights and gradients to Tensorboard.

log_embedding#

def log_embedding(tag, mat, labels, step)

Log model embeddings to Tensorboard.

log_graph#

def log_graph(model, device)

Logs model graphs to Tensorboard.

Arguments:

  • model object - unwrapped model with a function get_sample_input() implemented.
  • device str - device type.

log_image#

def log_image(k, v, step, dataformats='HW')

Log image in Tensorboard.

log_pr_curve#

def log_pr_curve(k, preds, labels, step)

Log Precision Recall curve in Tensorboard.

log_args#

def log_args(args)

Log all the Arguments used in the experiment to Tensorboard.

log_histogram#

def log_histogram(param_name, vals, step)

Log histograms in Tensorboard. Avoid using small step size since it impact training time.

flush#

def flush()

Flush the SummaryWriter to write out Summary to Tensorboard.

finish#

def finish()

Flush the SummaryWriter to write out Summary to Tensorboard and close SummaryWriter.