Skip to content

Commit cf31314

Browse files
committed
Moved export and wrote a docstring for the API method
1 parent 89a34e9 commit cf31314

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/TensorBoardLogger.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using Base.CoreLogging: CoreLogging, AbstractLogger, LogLevel, Info,
2121

2222
export TBLogger, reset!, set_step!, increment_step!, set_step_increment!, with_TBLogger_hold_step
2323
export log_histogram, log_value, log_vector, log_text, log_image, log_images,
24-
log_audio, log_audios, log_graph, log_embeddings, log_custom_scalar
24+
log_audio, log_audios, log_graph, log_embeddings, log_custom_scalar, write_hparams!
2525
export map_summaries, TBReader
2626

2727
export ImageFormat, L, CL, LC, LN, NL, NCL, NLC, CLN, LCN, HW, WH, HWC, WHC,

src/hparams.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ function encode_bytes(content::HP.HParamsPluginData)
7979
return take!(data)
8080
end
8181

82+
"""
83+
write_hparams!(logger::TBLogger, hparams::Dict{String, Any}, metrics::AbstractArray{String})
84+
85+
Writes the supplied hyperparameters to the logger, along with noting all metrics that should be tracked.
86+
87+
The value of `hparams` can be a `String`, `Bool` or a subtype of `Real`. All `Real` values are converted
88+
to `Float64` when writing the logs.
89+
90+
`metrics` should be a list of tags, which correspond to scalars that have been logged. Tensorboard will
91+
automatically extract the latest metric logged to use for this value.
92+
"""
8293
function write_hparams!(logger::TBLogger, hparams::Dict{String, Any}, metrics::AbstractArray{String})
8394
PLUGIN_NAME = "hparams"
8495
PLUGIN_DATA_VERSION = 0
@@ -118,7 +129,4 @@ function write_hparams!(logger::TBLogger, hparams::Dict{String, Any}, metrics::A
118129
write_event(logger, event)
119130
end
120131
nothing
121-
end
122-
123-
124-
export write_hparams!
132+
end

0 commit comments

Comments
 (0)