Write Logs

Chinese

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.

    • addrecord(_self: visualdl.core.ScalarWriter__float, arg0: int, arg1: float) → None
    • add a record with the step and value

    • setcaption(_self: visualdl.core.ScalarWriter__float, arg0: unicode) → None

  • class visualdl.core.HistogramWriterfloat[](http://visualdl.paddlepaddle.org/documentation/visualdl/zh/develop/api/#visualdl.core.HistogramWriterfloat)
  • PyBind class. Must instantiate through the LogWriter.

    • addrecord(_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.

    • addsample(_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:

  1. - **image_shape** (_tuple_) [width, height, number of channels(3 for RGB)]
  2. - **image_data** (_list_) Flatten image data
  • finishsampling(_self: visualdl.core.ImageWriter) → None
  • End a sampling period, it will clear all states for reservoir sampling.

  • issample_taken(_self: visualdl.core.ImageWriter) → int

  • 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) → None
  • PyBind 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:

  1. - **index** (_integer_)
  2. - **image_shape** (_tuple_) [width, height, number of channels(3 for RGB)]
  3. - **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.
  • class visualdl.core.TextWriter
  • PyBind class. Must instantiate through the LogWriter.

    • addrecord(_self: visualdl.core.TextWriter, arg0: int, arg1: unicode) → None
    • Add a record with the step and text value.

Parameters:

  1. - **step** (_integer_) Current step value
  2. - **text** (_basestring_) Text record
  • setcaption(_self: visualdl.core.TextWriter, arg0: unicode) → None
    • class visualdl.core.AudioWriter
    • PyBind class. Must instantiate through the LogWriter.
  • addsample(_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:

  1. - **audio_params** (_tuple_) [sample rate, sample width, number of channels]
  2. - **audio_data** (_list of uint8_) Flatten audio data
  • finishsampling(_self: visualdl.core.AudioWriter) → None
  • End a sampling period, it will clear all states for reservoir sampling.

  • issample_taken(_self: visualdl.core.AudioWriter) → int

  • 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) → None
  • PyBind 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:

  1. - **index** (_integer_)
  2. - **audio_params** (_tuple_) [sample rate, sample width, number of channels]
  3. - **audio_data** (_list_) Flatten audio data
  • startsampling(_self: visualdl.core.AudioWriter) → None
  • Start a sampling period, this interface will start a new reservoir sampling phase.