def get_optimizer_by_name(name, model):
    if (name not in optimizers):
        raise KeyError('Optimizer {} not found. Optimizer availables: {}'.format(repr(name), ', '.join(map(repr, optimizers.keys()))))
    return optimizers[name](model.parameters())
def get_optimizer_by_name(name, model):
    if (name not in optimizers):
        raise KeyError('Optimizer {} not found. Optimizer availables: {}'.format(repr(name), ', '.join(map(repr, optimizers.keys()))))
    return optimizers[name](model.parameters())