def get_loss_by_name(name):
    if (name not in losses):
        raise KeyError('Loss {} not found. Losses available: {}'.format(repr(name), ', '.join(map(repr, losses.keys()))))
    return losses[name]()
def get_loss_by_name(name):
    if (name not in losses):
        raise KeyError('Loss {} not found. Losses available: {}'.format(repr(name), ', '.join(map(repr, losses.keys()))))
    return losses[name]()