Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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