Write Logs

VisualDL uses PyBind to operate with the c++ framework. Users should use LogWriter to instantiate scalar/histogram/image writer

class visualdl.core.ScalarWriter__float

PyBind class. Must instantiate through the LogWriter.

add_record(self: visualdl.core.ScalarWriter__float, arg0: int, arg1: float) → None

add a record with the step and value

set_caption(self: visualdl.core.ScalarWriter__float, arg0: unicode) → None
class visualdl.core.HistogramWriter__float

PyBind class. Must instantiate through the LogWriter.

add_record(self: visualdl.core.HistogramWriter__float, arg0: int, arg1: List[float]) → None

add a record with the step and histogram_value

class visualdl.core.ImageWriter

PyBind class. Must instantiate through the LogWriter.

add_sample(self: visualdl.core.ImageWriter, arg0: List[int], arg1: List[float]) → None

A combined interface for is_sample_taken and set_sample, simpler but is less efficient. Image shape params details see set_sample

Parameters:
  • image_shape (tuple) – [width, height, number of channels(3 for RGB)]
  • image_data (list) – Flatten image data
finish_sampling(self: visualdl.core.ImageWriter) → None

End a sampling period, it will clear all states for reservoir sampling.

is_sample_taken(self: visualdl.core.ImageWriter) → int

Will this sample be taken, this interface is introduced to reduce the cost of copy image data, by testing whether this image will be sampled, and only copy data when it should be sampled. In that way, most of un-sampled image data need not be copied or processed at all.

Returns:Index
Return type:integer
set_caption(self: visualdl.core.ImageWriter, arg0: unicode) → None

PyBind class. Must instantiate through the LogWriter.

set_sample(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 be specified 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
start_sampling(self: visualdl.core.ImageWriter) → None

Start a sampling period, this interface will start a new reservoir sampling phase.

class visualdl.core.TextWriter

PyBind class. Must instantiate through the LogWriter.

add_record(self: visualdl.core.TextWriter, arg0: int, arg1: unicode) → None

Add a record with the step and text value.

Parameters:
  • step (integer) – Current step value
  • text (basestring) – Text record
set_caption(self: visualdl.core.TextWriter, arg0: unicode) → None
class visualdl.core.AudioWriter

PyBind class. Must instantiate through the LogWriter.

add_sample(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
finish_sampling(self: visualdl.core.AudioWriter) → None

End a sampling period, it will clear all states for reservoir sampling.

is_sample_taken(self: visualdl.core.AudioWriter) → int

Will this sample be taken, this interface is introduced to reduce the cost of copy audio data, by testing whether this audio will be sampled, and only copy data when it should be sampled. In that way, most of un-sampled audio data need not be copied or processed at all.

Returns:Index
Return type:integer
set_caption(self: visualdl.core.AudioWriter, arg0: unicode) → None

PyBind class. Must instantiate through the LogWriter.

set_sample(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 to be specified as a tuple of 3 integers as following: sample_rate: number of samples(frames) per second, e.g. 8000, 16000 or 44100 sample_width: size of each sample(frame) in bytes, 16bit frame will be 2 num_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
start_sampling(self: visualdl.core.AudioWriter) → None

Start a sampling period, this interface will start a new reservoir sampling phase.