Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docstring and typehint for epoch_log and iteration_log in TensorBoardStatsHandler #7027

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions monai/handlers/tensorboard_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def __init__(
self,
summary_writer: SummaryWriter | SummaryWriterX | None = None,
log_dir: str = "./runs",
iteration_log: bool | Callable[[Engine, int], bool] = True,
epoch_log: bool | Callable[[Engine, int], bool] = True,
iteration_log: bool | Callable[[Engine, int], bool] | int = True,
epoch_log: bool | Callable[[Engine, int], bool] | int = True,
epoch_event_writer: Callable[[Engine, Any], Any] | None = None,
epoch_interval: int = 1,
iteration_event_writer: Callable[[Engine, Any], Any] | None = None,
Expand All @@ -110,11 +110,13 @@ def __init__(
default to create a new TensorBoard writer.
log_dir: if using default SummaryWriter, write logs to this directory, default is `./runs`.
iteration_log: whether to write data to TensorBoard when iteration completed, default to `True`.
``iteration_log`` can be also a function and it will be interpreted as an event filter
``iteration_log`` can be also a function or int. If it is an int, it will be interpreted as the iteration interval
at which the iteration_event_writer is called. If it is a function, it will be interpreted as an event filter
(see https://pytorch.org/ignite/generated/ignite.engine.events.Events.html for details).
Event filter function accepts as input engine and event value (iteration) and should return True/False.
epoch_log: whether to write data to TensorBoard when epoch completed, default to `True`.
``epoch_log`` can be also a function and it will be interpreted as an event filter.
``epoch_log`` can be also a function or int. If it is an int, it will be interpreted as the epoch interval
at which the epoch_event_writer is called. If it is a function, it will be interpreted as an event filter.
See ``iteration_log`` argument for more details.
epoch_event_writer: customized callable TensorBoard writer for epoch level.
Must accept parameter "engine" and "summary_writer", use default event writer if None.
Expand Down
Loading