def make_fig_1()

in figs/fig_1.py [0:0]


def make_fig_1():
    ## Branin
    # Evaluate the usual Branin problem, but scaled to [-1, 1]^2
    grid_x1, grid_y1, fs_branin = eval_f_on_grid(branin_centered, [-1, 1], [-1, 1], {}, 2)

    # Generate a REMBO projection matrix
    D = 100
    np.random.seed(1)
    A_b = np.random.randn(D, 2)
    # Evaluate the function across the low-d space
    bounds = [-np.sqrt(2), np.sqrt(2)]
    grid_x2, grid_y2, fs_rembo = eval_f_on_grid(rembo_branin, bounds, bounds, {'A': A_b}, 2)

    ## Hartmann6
    # Evaluate the usual Hartmann6 problem, but scaled to [-1, 1]^6
    grid_x1h, grid_y1h, fs_hartmann6 = eval_f_on_grid(hartmann6_centered, [-1, 1], [-1, 1], {}, 6)

    # Generate a REMBO projection matrix
    D = 100
    A_h = np.random.randn(D, 6)
    # Evaluate the function across the low-d space
    bounds = [-np.sqrt(6), np.sqrt(6)]
    grid_x2h, grid_y2h, fs_rembo_h = eval_f_on_grid(rembo_hartmann6, bounds, bounds, {'A': A_h}, 6)

    # Make the figure
    fig = plt.figure(figsize=(5.5, 1.2), facecolor='w', edgecolor='w')
    plt.set_cmap('RdBu_r')

    ### Branin

    ax = fig.add_subplot(141)
    CS1 = ax.contourf(grid_x1, grid_y1, np.log(fs_branin), levels=np.linspace(-1, 6, 30))
    ax.grid(False)
    #ax.set_xlabel(r'$x_1$', fontsize=9)
    ax.set_xlim([-1, 1])
    #ax.set_xticks([-1, -0.5, 0, 0.5, 1])
    ax.set_xticks([])
    #ax.set_ylabel(r'$x_2$', fontsize=9)
    ax.set_ylim([-1, 1])
    ax.set_yticks([])
    #ax.set_yticks([-1, -0.5, 0, 0.5, 1])
    ax.set_title(r'Branin function, $d$=2')

    ax = fig.add_subplot(142)
    CS1 = ax.contourf(grid_x2, grid_y2, np.log(fs_rembo), levels=np.linspace(-1, 6, 30))
    ax.grid(False)
    #ax.set_xlabel(r'$x_1$', fontsize=9)
    ax.set_xlim([-np.sqrt(2), np.sqrt(2)])
    ax.set_xticks([])
    #ax.set_xticks([-1.4, -1, -0.5, 0, 0.5, 1, 1.4])
    #ax.set_ylabel(r'$x_2$', fontsize=9)
    ax.set_ylim([-np.sqrt(2), np.sqrt(2)])
    ax.set_yticks([])
    #ax.set_yticks([-1.4, -1, -0.5, 0, 0.5, 1, 1.4])
    ax.set_title('REMBO embedding,\n$D$=100, $d_e$=2')

    ### Hartmann6

    ax = fig.add_subplot(143)
    CS1f = ax.contourf(grid_x1h, grid_y1h, fs_hartmann6, levels=np.linspace(-1.2, 0., 20))
    ax.grid(False)
    #ax.set_xlabel(r'$x_1$', fontsize=9)
    ax.set_xlim([-1, 1])
    ax.set_xticks([])
    #ax.set_xticks([-1, -0.5, 0, 0.5, 1])
    #ax.set_ylabel(r'$x_2$', fontsize=9)
    ax.set_ylim([-1, 1])
    ax.set_yticks([])
    #ax.set_yticks([-1, -0.5, 0, 0.5, 1])
    ax.set_title(r'Hartmann6 function, $d$=6')

    ax = fig.add_subplot(144)
    CS1f = ax.contourf(grid_x2h, grid_y2h, fs_rembo_h, levels=np.linspace(-1.2, 0., 20))
    ax.grid(False)
    #ax.set_xlabel(r'$x_1$', fontsize=9)
    ax.set_xlim([-np.sqrt(6), np.sqrt(6)])
    ax.set_xticks([])
    #ax.set_xticks([-2, -1, 0, 1, 2,])
    #ax.set_ylabel(r'$x_2$', fontsize=9)
    ax.set_ylim([-np.sqrt(6), np.sqrt(6)])
    ax.set_yticks([])
    #ax.set_yticks([-2, -1, 0, 1, 2,])
    ax.set_title('REMBO embedding,\n$D$=100, $d_e$=6')

    fig.subplots_adjust(wspace=0.13, top=0.74, bottom=0.05, right=0.99, left=0.01)
    plt.savefig('pdfs/rembo_illustrations_w.pdf', pad_inches=0)