Write Logs
VisualDL uses PyBind to operate with the c++ framework. Users should use LogWriter to instantiate scalar/histogram/image writer
- class
visualdl.core.
ScalarWriterfloat
[](http://visualdl.paddlepaddle.org/documentation/visualdl/zh/develop/api/#visualdl.core.ScalarWriterfloat) PyBind class. Must instantiate through the LogWriter.
- class
visualdl.core.
HistogramWriterfloat
[](http://visualdl.paddlepaddle.org/documentation/visualdl/zh/develop/api/#visualdl.core.HistogramWriterfloat) PyBind class. Must instantiate through the LogWriter.
PyBind class. Must instantiate through the LogWriter.
Parameters:
- **image_shape** (_tuple_) – [width, height, number of channels(3 for RGB)]
- **image_data** (_list_) – Flatten image data
finishsampling
(_self: visualdl.core.ImageWriter) → NoneEnd a sampling period, it will clear all states for reservoir sampling.
- Will this sample be taken, this interface is introduced to reduce the costof copy image data, by testing whether this image will be sampled, and onlycopy data when it should be sampled. In that way, most of un-sampled imagedata need not be copied or processed at all.
Returns:IndexReturn type:integer
setcaption
(_self: visualdl.core.ImageWriter, arg0: unicode) → NonePyBind class. Must instantiate through the LogWriter.
setsample
(_self: visualdl.core.ImageWriter, arg0: int, arg1: List[int], arg2: List[float]) → None- Store the flatten image data as vector of float types. Image params need to bespecified as a tuple of 3 integers for [width, height, number of channels(3 for RGB)]
Parameters:
- **index** (_integer_) –
- **image_shape** (_tuple_) – [width, height, number of channels(3 for RGB)]
- **image_data** (_list_) – Flatten image data
startsampling
(_self: visualdl.core.ImageWriter) → None- Start a sampling period, this interface will start a new reservoir sampling phase.
Parameters:
- **step** (_integer_) – Current step value
- **text** (_basestring_) – Text record
setcaption
(_self: visualdl.core.TextWriter, arg0: unicode) → Noneaddsample
(_self: visualdl.core.AudioWriter, arg0: List[int], arg1: List[int]) → None- A combined interface for is_sample_taken and set_sample, simpler but is less efficient.Audio params details see set_sample
Parameters:
- **audio_params** (_tuple_) – [sample rate, sample width, number of channels]
- **audio_data** (_list of uint8_) – Flatten audio data
finishsampling
(_self: visualdl.core.AudioWriter) → NoneEnd a sampling period, it will clear all states for reservoir sampling.
- Will this sample be taken, this interface is introduced to reduce the costof copy audio data, by testing whether this audio will be sampled, and onlycopy data when it should be sampled. In that way, most of un-sampled audiodata need not be copied or processed at all.
Returns:IndexReturn type:integer
setcaption
(_self: visualdl.core.AudioWriter, arg0: unicode) → NonePyBind class. Must instantiate through the LogWriter.
setsample
(_self: visualdl.core.AudioWriter, arg0: int, arg1: List[int], arg2: List[int]) → None- Store the flatten audio data as vector of uint8 types. Audio params need tobe specified as a tuple of 3 integers as following:sample_rate: number of samples(frames) per second, e.g. 8000, 16000 or 44100sample_width: size of each sample(frame) in bytes, 16bit frame will be 2num_channels: number of channels associated with the audio data, normally 1 or 2
Parameters:
- **index** (_integer_) –
- **audio_params** (_tuple_) – [sample rate, sample width, number of channels]
- **audio_data** (_list_) – Flatten audio data