snorkel.classification.TensorBoardWriter

class snorkel.classification.TensorBoardWriter(**kwargs)[source]

Bases: snorkel.classification.training.loggers.log_writer.LogWriter

A class for logging to Tensorboard during training process.

See LogWriter for more attributes.

Parameters

kwargs (Any) – Passed to LogWriter initializer

writer[source]

tensorboardX SummaryWriter for logging and visualization

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

Return type

None

Methods

__init__(**kwargs)

Initialize self.

add_scalar(name, value, step)

Log a scalar variable to TensorBoard.

cleanup()

Close the SummaryWriter.

write_config(config[, config_filename])

Dump the config to file and add it to TensorBoard.

write_json(dict_to_write, filename)

Dump a JSON-compatbile object to root log directory.

write_log(log_filename)

Dump the scalar value log to file.

write_text(text, filename)

Dump user-provided text to filename (e.g., the launch command).

add_scalar(name, value, step)[source]

Log a scalar variable to TensorBoard.

Parameters
  • name (str) – Name of the scalar collection

  • value (float) – Value of scalar

  • step (float) – Step axis value

Return type

None

cleanup()[source]

Close the SummaryWriter.

Return type

None

write_config(config, config_filename='config.json')[source]

Dump the config to file and add it to TensorBoard.

Parameters
  • config (Namedtuple) – JSON-compatible config to write to TensorBoard

  • config_filename (str) – File to write config to

Return type

None

write_json(dict_to_write, filename)[source]

Dump a JSON-compatbile object to root log directory.

Parameters
  • dict_to_write (Mapping[str, Any]) – JSON-compatbile object to log

  • filename (str) – Name of file in logging directory to write to

Return type

None

write_log(log_filename)[source]

Dump the scalar value log to file.

Parameters

log_filename (str) – Name of file in logging directory to write to

Return type

None

write_text(text, filename)[source]

Dump user-provided text to filename (e.g., the launch command).

Parameters
  • text (str) – Text to write

  • filename (str) – Name of file in logging directory to write to

Return type

None