def get_number_of_epochs(opt, loader_train):
    """define the number of training epochs based on the lenght of the dataset and the number of steps"""
    epochs = opt['epochs']
    iter_per_epoch = -(-len(loader_train.dataset) // opt['bs'])
    if epochs < 0:
        epochs = 1 + opt['nsteps'] // iter_per_epoch
    return epochs, iter_per_epoch