snorkel.classification.LogWriter¶
-
class
snorkel.classification.LogWriter(**kwargs)[source]¶ Bases:
objectA class for writing logs.
- Parameters
kwargs (
Any) – Settings to merge into LogWriterConfig
-
__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.
cleanup()Perform final operations and close writer if necessary.
write_config(config[, config_filename])Dump the config to file.
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.
- 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.
- Parameters
config (
Namedtuple) – JSON-compatible config to write to fileconfig_filename (
str) – Name of file in logging directory to write 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