Example #1
0
 def add_graph(self, ops):
     """
     Add a graph to the current tensorboard run
     Arguments:
         ops (Op, Iterable): Ops to serialize as a TensorFlow Graph
     """
     graph_def = ngraph_to_tf_graph_def(ops)
     self._write_event(create_event(graph_def=graph_def))
Example #2
0
    def add_scalar(self, name, scalar, step=None):
        """
        Add a scalar to the current tensorboard run

        Arguments:
            name (str): Display name within tensorboard
            scalar (int, float): Scalar value to be logged
            step (int, optional): Step in the series. Optional, but should usually be provided.
        """

        summ = summary.scalar(name, scalar)
        self._write_event(create_event(summary=summ, step=step))
Example #3
0
    def add_audio(self, name, audio, sample_rate, step=None):
        """
        Add an audio clip to the current tensorboard run

        Arguments:
            name (str): Display name within tensorboard
            audio (ndarray): 2-D array containing the audio clip to be logged. It should be
                             formatted as Frames by Channels.
            sample_rate (float): Sample rate of audio in Hertz
            step (int, optional): Step in the series
        """

        summ = summary.audio(name, audio, sample_rate)
        self._write_event(create_event(summary=summ, step=step))
Example #4
0
    def add_histogram(self, name, sequence, step=None):
        """
        Add a histogram to the current tensorboard run

        Arguments:
            name (str): Display name within tensorboard
            sequence (ndarray, Iterable): A sequence on which to compute a histogram of values
            step (int, optional): Step in the series. Optional, but should usually be provided.
        """

        if isinstance(sequence, np.ndarray):
            sequence = np.ravel(sequence)
        summ = summary.histogram(name, sequence)
        self._write_event(create_event(summary=summ, step=step))
Example #5
0
    def add_image(self, name, image, step=None):
        """
        Add an image to the current tensorboard run

        Arguments:
            name (str): Display name within tensorboard
            image (ndarray): 3-D array containing the image to be logged. It should be
                             formatted as Height by Width by Channels, where 1 channel is
                             greyscale, 3 channels is RGB, and 4 channels is RGBA.
            step (int, optional): Step in the series
        """

        summ = summary.image(name, image)
        self._write_event(create_event(summary=summ, step=step))