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 toLogWriter
initializer
-
__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 collectionvalue (
float
) – Value of scalarstep (
float
) – Step axis value
- 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 TensorBoardconfig_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 logfilename (
str
) – Name of file in logging directory to write to
- Return type
None