How to use the ivis.nn.callbacks.EmbeddingsImage function in ivis

To help you get started, we’ve selected a few ivis 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 beringresearch / ivis / ivis / nn / callbacks.py View on Github external
def __init__(self, data, labels=None, log_dir='./logs',
                 filename='{}_embeddings.png', epoch_interval=1):
        super(EmbeddingsImage, self).__init__()
        _check_visualization_libraries()

        self.data = data
        if labels is not None:
            self.labels = labels
        else:
            self.labels = np.zeros(len(data))
        self.n_classes = len(np.unique(self.labels, axis=0))
        self.log_dir = log_dir
        os.makedirs(log_dir, exist_ok=True)
        self.filename = filename
        self.epoch_interval = epoch_interval
        self.epochs_since_last_save = 0