コード例 #1
0
def get_dataset(CONFIG, X, Y, z_r):
    data = gprn.Dataset()
    num_data_sources = X.shape[0]

    for i in range(num_data_sources):
        x = np.array(X[i])
        y = np.array(Y[i])

        M = x.shape[1]
        print(M)

        b = 300
        b = b if b < x.shape[0] else None

        if CONFIG['exp_ignore_i'] is not None:
            if i == CONFIG['exp_ignore_i']: continue

        data.add_source_dict({
            'M': M,
            'x': x,
            'y': y,
            #'z': x,
            'batch_size': b
        })

    data.add_inducing_points(z_r)
    return data
コード例 #2
0
def get_dataset(X, Y, z_r):
    data = gprn.Dataset()
    num_data_sources = X.shape[0]

    for i in range(num_data_sources):
    #for i in [0]:
    #for i in [1]:
        x = X[i]
        y = Y[i]
        print('dataset: ', i, ' ',  x.shape)

        M = x.shape[1]

        data.add_source_dict({
            'active_tasks': [[0], [0]],
            'M': M,
            'x': x,
            'y': y,
            'z': z_r,
            'batch_size': None

        })


    #data.add_inducing_points(z_r);
    return data
コード例 #3
0
def get_dataset(X, Y, z_r):
    data = gprn.Dataset()

    rs = lambda x: x.reshape([x.shape[0] * x.shape[1], x.shape[2]])

    for i in [1]:
        x = X[i][:, 0, :]
        y = Y[i]
        print('dataset: ', i, ' ', x.shape)

        data.add_source_dict({'x': x, 'y': y, 'z': z_r, 'batch_size': None})

    #data.add_inducing_points(z_r);
    return data