def optimizer_factory(optimizer, lr, momentum=None, clipnorm=0.0, clipvalue=1):
    if (optimizer == 'Adam'):
        return Adam(lr=lr, clipnorm=clipnorm, clipvalue=clipvalue)
    elif (optimizer == 'SGD'):
        return SGD(lr=lr, momentum=momentum, clipnorm=clipnorm, clipvalue=clipvalue)
def optimizer_factory(optimizer, lr, momentum=None, clipnorm=0.0, clipvalue=1):
    if (optimizer == 'Adam'):
        return Adam(lr=lr, clipnorm=clipnorm, clipvalue=clipvalue)
    elif (optimizer == 'SGD'):
        return SGD(lr=lr, momentum=momentum, clipnorm=clipnorm, clipvalue=clipvalue)