ml.loggers.stdout
Defines a simple logger that writes to stdout.
I put a bunch of colors in here to make it easier to quickly find logged
values of interest, but the colors can be disabled by setting the
environment variable DISABLE_COLORS=1
- class ml.loggers.stdout.StdoutLoggerConfig(name: str = '???', write_every_n_seconds: float | None = None, write_train_every_n_seconds: float | None = None, write_val_every_n_seconds: float | None = None, precision: int = 4)[source]
Bases:
BaseLoggerConfig
- precision: int = 4
- class ml.loggers.stdout.StdoutLogger(config: StdoutLoggerConfig)[source]
Bases:
BaseLogger
[StdoutLoggerConfig
]- log_scalar(key: str, value: Callable[[], int | float | Tensor], state: State, namespace: str) None [source]
Logs a scalar value.
- Parameters:
key – The key to log
value – The value to log
state – The current log state
namespace – The namespace to be logged