MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / param_group_multitask

Function param_group_multitask

PATH/core/make_param_group.py:57–78  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

55 return param_group
56
57def param_group_multitask(model):
58 backbone_group = []
59 neck_group = []
60 decoder_group = []
61 other_group = []
62 for name, p in model.named_parameters():
63 if 'module.backbone_module' in name:
64 backbone_group.append(p)
65 elif 'module.neck_module' in name:
66 neck_group.append(p)
67 elif 'module.decoder_module' in name:
68 decoder_group.append(p)
69 else:
70 other_group.append(p)
71
72 if len(other_group) > 0:
73 param_group = [{'params': backbone_group}, {'params': neck_group}, \
74 {'params': decoder_group}, {'params', other_group}]
75 else:
76 param_group = [{'params': backbone_group}, {'params': neck_group}, \
77 {'params': decoder_group}]
78 return param_group
79
80
81def get_num_layer_for_vit(var_name, num_max_layer):

Callers 1

create_optimizerMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected