tensorboard
allennlp.training.callbacks.tensorboard
TensorBoardCallback¶
@TrainerCallback.register("tensorboard")
class TensorBoardCallback(LogWriterCallback):
| def __init__(
| self,
| serialization_dir: str,
| summary_interval: int = 100,
| distribution_interval: Optional[int] = None,
| batch_size_interval: Optional[int] = None,
| should_log_parameter_statistics: bool = False,
| should_log_learning_rate: bool = False
| ) -> None
A callback that writes training statistics/metrics to TensorBoard.
log_scalars¶
class TensorBoardCallback(LogWriterCallback):
| ...
| def log_scalars(
| self,
| scalars: Dict[str, Union[int, float]],
| log_prefix: str = "",
| epoch: Optional[int] = None
| ) -> None
log_tensors¶
class TensorBoardCallback(LogWriterCallback):
| ...
| def log_tensors(
| self,
| tensors: Dict[str, torch.Tensor],
| log_prefix: str = "",
| epoch: Optional[int] = None
| ) -> None
close¶
class TensorBoardCallback(LogWriterCallback):
| ...
| def close(self) -> None
Calls the close
method of the SummaryWriter
s which makes sure that pending
scalars are flushed to disk and the tensorboard event files are closed properly.