Exported
TensorBoardLogger.TBLogger — TypeTBLogger(logdir[, tb_increment];
time=time(),
prefix="",
purge_step=nothing,
step_increment=1,
min_level=Logging.Info)Creates a TensorBoardLogger in the folder logdir. The second (optional) argument specifies the behaviour if the logdir already exhists: the default choice tb_increment appends an increasing number 1,2... to logdir. Other choices are tb_overwrite, which overwrites the previous folder, and tb_append, which adds to any existing logs.
Optional keyword argument prefix can be passed to prepend a path to the file name (note, not the log directory). See create_eventfile()
If a purge_step::Int is passed, every step before purge_step will be ignored by tensorboard (usefull in the case of restarting a crashed computation).
min_level specifies the minimum level of messages logged to tensorboard.
TensorBoardLogger.reset! — Functionreset!(lg)Reset the TBLogger lg, deleting everything in its log directory.
TensorBoardLogger.set_step! — Functionset_step!(lg, step) -> IntSets the iteration counter in the logger to step. This counter is used by the logger when no value is passed by the user.
TensorBoardLogger.increment_step! — Functionincrement_step!(lg, Δ_Step) -> IntIncrements the step counter in the logger by Δ_Step and returns the new value.
TensorBoardLogger.with_TBLogger_hold_step — Functionwith_TBLogger_hold_step(f, [step]; step_at_end::Bool=true) Context function to ease control of logging steps and synchronization. Amount of step increment can be controlled via set_step_increment!`.
Example:
with_logger(lg) do
for epoch in 1:10
for i=1:100
# increments global_step by default
with_TBLogger_hold_step() do
# all of these are logged at the same global_step
# and the logger global_step is only then increased
@info "train1/scalar" i=i
@info "train2/scalar" i2=i^2
@info "train3/scalar" i3=i^3
end
end
# step increment at end can be disabled for easy train/test sync
with_TBLogger_hold_step(;step_at_end=false) do
# all of these are logged at the same global_step
# and the logger global_step is only then increased
@info "test1/scalar" i=i
@info "test2/scalar" i2=i^2
@info "test3/scalar" i3=i^3
end
end
endTensorBoardLogger.set_step_increment! — Functionset_step_increment!(lg, increment) -> IntSets the default increment applyed to logger lg's iteration counter each time logging is performed.
Can be overidden by passing log_step_increment=some_increment when logging.
TensorBoardLogger.PNGImage.PngImage — TypePngImageA wrapper around the binary encoding of a PNG image, holding its attributes