Ejemplo n.º 1
0
def list_shuffle(*data):
    idxs = np_rng.permutation(np.arange(len(data[0])))
    if len(data) == 1:
        return [data[0][idx] for idx in idxs]
    else:
        return [[d[idx] for idx in idxs] for d in data]
Ejemplo n.º 2
0
def shuffle_list(*data):
    idxs = np_rng.permutation(np.arange(len(data[0])))
    if len(data) == 1:
        return [data[0][idx] for idx in idxs]
    else:
        return [[d[idx] for idx in idxs] for d in data]
Ejemplo n.º 3
0
def tensor_shuffle(data1, data2):
    print(data1)
    idxs = np_rng.permutation(np.arange(data1.shape[0]))
    return data1[idxs], data2[idxs]