Specifying a backend
By default TensorBoardLogger follows these rules to choose what backend a certain value is sent to:
::AbstractVector{<:Real}
-> Histogram backend as a vector::StatsBase.Histogram
-> Histogram backend
<!– - (bin_edges, weights)::Tuple{AbstractVector,AbstractVector}
where length(bin_edges)==length(weights)+1
, is interpreted as an histogram. (Will be deprecated. Please use TBHistogram(edges, weights)
for this). –>
::Real
-> Scalar backend::AbstractArray{<:Colorant}
-> Image backend::Any
-> Text Backend
In addition, struct
ures are not logged to text, but rather all their fields are (recursively) dispatched according to the rules above.
If you want to override those defaults, or you wish to specify some additional details, you can wrap any object into one of the following wrappers:
TBText
-> sends data to Text backendTBAudio
,TBAudios
-> sends data to audio backendTBHistogram
,TBVector
-> sends data to the Distributions backend, either as an histogram or as a vectorTBImage
,TBImages
-> Sends data to the images backend
To use those overrides, you simply wrap your type. Some overrides require additional parameters. For example, to log a vector as text you can do the following:
@info "mytag" TBText([1,2,3])
TensorBoardLogger.TBText
— TypeTBText(data)
Forces data
to be serialized as text to TensorBoard.
TensorBoardLogger.TBHistogram
— TypeTBHistogram(data)
Forces data
to be serialized as an histogram to TensorBoard.
TensorBoardLogger.TBVector
— TypeTBVector(data)
Forces data
to be serialized as a vector in the histogram backend of TensorBoard.
TensorBoardLogger.TBAudio
— TypeTBAudio(data, samplerate)
Forces data
to be serialized as Audio to TensorBoard.
TensorBoardLogger.TBAudios
— TypeTBAudios(data, samplerate)
Forces elements of Array data
to be serialized as Audio to TensorBoard.
TensorBoardLogger.TBImage
— TypeTBImage(data, format)
Forces data
to be serialized as an Image to TensorBoard.
TensorBoardLogger.TBImages
— TypeTBImages(data, format)
Forces elements of Array data
to be serialized as an Image to TensorBoard.