if idx < num_train:  # train
        fidx = 0
    elif idx < (num_train + num_val):  # val
        fidx = 1
    else:  # test