tabensemb.model.AbstractNN.log_dict#
method
- AbstractNN.log_dict(dictionary: Mapping[str, Metric | Tensor | int | float | Mapping[str, Metric | Tensor | int | float]], prog_bar: bool = False, logger: bool | None = None, on_step: bool | None = None, on_epoch: bool | None = None, reduce_fx: str | Callable = 'mean', enable_graph: bool = False, sync_dist: bool = False, sync_dist_group: Any | None = None, add_dataloader_idx: bool = True, batch_size: int | None = None, rank_zero_only: bool = False) None#
Log a dictionary of values at once.
Example:
values = {'loss': loss, 'acc': acc, ..., 'metric_n': metric_n} self.log_dict(values)
- Parameters:
dictionary¶ – key value pairs. The values can be a
float,Tensor,Metric, a dictionary of the former or aMetricCollection.prog_bar¶ – if
Truelogs to the progress base.logger¶ – if
Truelogs to the logger.on_step¶ – if
Truelogs at this step.Noneauto-logs for training_step but not validation/test_step. The default value is determined by the hook. See extensions/logging:Automatic Logging for details.on_epoch¶ – if
Truelogs epoch accumulated metrics.Noneauto-logs for val/test step but nottraining_step. The default value is determined by the hook. See extensions/logging:Automatic Logging for details.reduce_fx¶ – reduction function over step values for end of epoch.
torch.mean()by default.enable_graph¶ – if
True, will not auto-detach the graphsync_dist¶ – if
True, reduces the metric across GPUs/TPUs. Use with care as this may lead to a significant communication overhead.sync_dist_group¶ – the ddp group to sync across.
add_dataloader_idx¶ – if
True, appends the index of the current dataloader to the name (when using multiple). IfFalse, user needs to give unique names for each dataloader to not mix values.batch_size¶ – Current batch size. This will be directly inferred from the loaded batch, but some data structures might need to explicitly provide it.
rank_zero_only¶ – Whether the value will be logged only on rank 0. This will prevent synchronization which would produce a deadlock as not all processes would perform this log call.