c=dict(crop=(0.35, 0.45), center=0.4), d=dict(crop=(0.45, 0.55), center=0.5), e=dict(crop=(0.55, 0.65), center=0.6), f=dict(crop=(0.65, 0.75), center=0.7), ) COLORS_272 = np.load(os.path.join(os.path.dirname(__file__), '..', 'tools', 'colors_272.npy')) RE_COMPUTE_ENTROPY = False NUM_BINS = 10 TMP_DIR = os.path.join('.', 'tmp_mutual') if not os.path.exists(TMP_DIR): os.mkdir(TMP_DIR) DRAWER = Drawer() SHOW = False # %% Tools def hist(x, y, num_bins=NUM_BINS): _range = (min((min(x), min(y))), max((max(x), max(y)))) x_hist, edges = np.histogram(x, bins=num_bins, range=_range) y_hist, _ = np.histogram(y, bins=edges) xy_hist, _, _ = np.histogram2d(x, y, bins=(edges, edges), range=_range) return (x_hist / num_bins, y_hist / num_bins, np.ravel(xy_hist) / num_bins)
def __init__(self, title_prefix='', show=False): self.epochs = None self.drawer = Drawer() self.title_prefix = title_prefix self.show = show