MCPcopy
hub / github.com/open-mmlab/OpenPCDet / create

Method create

tools/train_utils/optimization/fastai_optim.py:115–122  ·  view source on GitHub ↗

Create an `optim.Optimizer` from `opt_func` with `lr`. Set lr on `layer_groups`.

(cls, opt_func, lr,
               layer_groups, **kwargs)

Source from the content-addressed store, hash-verified

113
114 @classmethod
115 def create(cls, opt_func, lr,
116 layer_groups, **kwargs):
117 "Create an `optim.Optimizer` from `opt_func` with `lr`. Set lr on `layer_groups`."
118 split_groups = split_bn_bias(layer_groups)
119 opt = opt_func([{'params': trainable_params(l), 'lr': 0} for l in split_groups])
120 opt = cls(opt, **kwargs)
121 opt.lr, opt.opt_func = listify(lr, layer_groups), opt_func
122 return opt
123
124 def new(self, layer_groups):
125 "Create a new `OptimWrapper` from `self` with another `layer_groups` but the same hyper-parameters."

Callers 4

newMethod · 0.95
build_optimizerFunction · 0.45
createMethod · 0.45
sa_createFunction · 0.45

Calls 3

split_bn_biasFunction · 0.85
trainable_paramsFunction · 0.85
listifyFunction · 0.85

Tested by

no test coverage detected