(model)
| 610 | |
| 611 | |
| 612 | def get_params_groups(model): |
| 613 | regularized = [] |
| 614 | not_regularized = [] |
| 615 | for name, param in model.named_parameters(): |
| 616 | if not param.requires_grad: |
| 617 | continue |
| 618 | # we do not regularize biases nor Norm parameters |
| 619 | if name.endswith(".bias") or len(param.shape) == 1: |
| 620 | not_regularized.append(param) |
| 621 | else: |
| 622 | regularized.append(param) |
| 623 | return [{'params': regularized}, {'params': not_regularized, 'weight_decay': 0.}] |
| 624 | |
| 625 | |
| 626 | def has_batchnorms(model): |
nothing calls this directly
no outgoing calls
no test coverage detected