pytorch_lightning.loggers.csv_logs module¶
CSV logger¶
CSV logger for basic experiment logging that does not require opening ports
-
class
pytorch_lightning.loggers.csv_logs.
CSVLogger
(save_dir, name='default', version=None)[source]¶ Bases:
pytorch_lightning.loggers.base.LightningLoggerBase
Log to local file system in yaml and CSV format. Logs are saved to
os.path.join(save_dir, name, version)
.Example
>>> from pytorch_lightning import Trainer >>> from pytorch_lightning.loggers import CSVLogger >>> logger = CSVLogger("logs", name="my_exp_name") >>> trainer = Trainer(logger=logger)
- Parameters
-
log_metrics
(metrics, step=None)[source]¶ Records metrics. This method logs metrics as as soon as it received them. If you want to aggregate metrics for one specific step, use the
agg_and_log_metrics()
method.
-
property
experiment
[source]¶ Actual ExperimentWriter object. To use ExperimentWriter features in your
LightningModule
do the following.Example:
self.logger.experiment.some_experiment_writer_function()
- Return type
-
property
log_dir
[source]¶ The log directory for this run. By default, it is named
'version_${self.version}'
but it can be overridden by passing a string value for the constructor’s version parameter instead ofNone
or an int.- Return type
-
property
root_dir
[source]¶ Parent directory for all checkpoint subdirectories. If the experiment name parameter is
None
or the empty string, no experiment subdirectory is used and the checkpoint will be saved in “save_dir/version_dir”- Return type