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

Method set_val

tools/train_utils/fastai_optim.py:220–226  ·  view source on GitHub ↗

Set `val` inside the optimizer dictionary at `key`.

(self, key: str, val, bn_groups: bool = True)

Source from the content-addressed store, hash-verified

218 if 'weight_decay' in self.opt_keys: self._wd = self.read_val('weight_decay')
219
220 def set_val(self, key: str, val, bn_groups: bool = True):
221 "Set `val` inside the optimizer dictionary at `key`."
222 if is_tuple(val): val = [(v1, v2) for v1, v2 in zip(*val)]
223 for v, pg1, pg2 in zip(val, self.opt.param_groups[::2], self.opt.param_groups[1::2]):
224 pg1[key] = v
225 if bn_groups: pg2[key] = v
226 return val
227
228 def read_val(self, key: str):
229 "Read a hyperparameter `key` in the optimizer dictionary."

Callers 5

stepMethod · 0.95
lrMethod · 0.95
momMethod · 0.95
betaMethod · 0.95
wdMethod · 0.95

Calls 1

is_tupleFunction · 0.85

Tested by

no test coverage detected