(cls, opt_func, lr, layer_groups, **kwargs)
return opt
Create an `optim.Optimizer` from `opt_func` with `lr`. Set lr on `layer_groups`.
Create an `optim.Optimizer` from `opt_func` with `lr`. Set lr on `layer_groups`.
Create an optim . Optimizer from opt_func with lr . Set lr on layer_groups .
def create(cls, opt_func, lr, layer_groups, **kwargs):
        "Create an `optim.Optimizer` from `opt_func` with `lr`. Set lr on `layer_groups`."
        split_groups = split_bn_bias(layer_groups)
        opt = opt_func([{
            'params': trainable_params(l),
            'lr': 0
        } for l in split_groups])
        opt = cls(opt, **kwargs)
        opt.lr, opt.opt_func = listify(lr, layer_groups), opt_func
        return opt
def create ( cls , opt_func , lr , layer_groups , * * kwargs ) : split_groups = split_bn_bias ( layer_groups ) opt = opt_func ( [ { 'params' : trainable_params ( l ) , 'lr' : 0 } for l in split_groups ] ) opt = cls ( opt , * * kwargs ) opt . lr , opt . opt_func = listify ( lr , layer_groups ) , opt_func return opt