import json


def load_train_val_indices(file_name):
    """Generate random indices for training and validation set

    Parameters
    ==========
    file_name : str
        Output json file name.

    Returns
    =======
    train_indices : list(int)
    val_indices : list(int)
    """

    with open(file_name, 'r') as fp:
        print("Loading from {}...".format(file_name))
        data = json.load(fp)
        return data['train'], data['validation']