How to use the visdom._assert_opts function in visdom

To help you get started, we’ve selected a few visdom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MIC-DKFZ / trixi / trixi / util / extravisdom.py View on Github external
def histogram_3d(self, X, win=None, env=None, opts=None):
        """
        Given an array it plots the histrograms of the entries

        :param X: An array of at least 2 dimensions, where the first dimensions gives the number of histograms
        :param win: Window name
        :param env: Env name
        :param opts: dict with options, especially opts['numbins'] (number of histogram bins) and opts['mutiplier']
        ( factor to stretch / queeze the values on the x axis) should ne considered
        :return: The send result
        """

        opts = {} if opts is None else opts
        _assert_opts(opts)

        X = np.asarray(X)
        assert X.ndim >= 2, 'X must have atleast 2 dimensions'

        opts['numbins'] = opts.get('numbins', min(30, len(X[0])))
        opts['mutiplier'] = opts.get('numbins', 100)

        traces = []
        for i, array in enumerate(X):
            array = array.flatten()
            bins, intervals = np.histogram(array, bins=opts['numbins'])

            x = []
            y = []
            z = []
            prev_interv = 0.

visdom

A tool for visualizing live, rich data for Torch and Numpy

Apache-2.0
Latest version published 2 years ago

Package Health Score

63 / 100
Full package analysis