MCPcopy
hub / github.com/sshaoshuai/PointRCNN / create

Method create

tools/train_utils/fastai_optim.py:112–119  ·  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

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

Callers 3

newMethod · 0.95
create_optimizerFunction · 0.45
createMethod · 0.45

Calls 3

split_bn_biasFunction · 0.85
trainable_paramsFunction · 0.85
listifyFunction · 0.85

Tested by

no test coverage detected