MCPcopy Index your code
hub / github.com/OpenGVLab/InternVL / get_parameter_groups

Function get_parameter_groups

classification/main_deepspeed.py:137–156  ·  view source on GitHub ↗
(model, config)

Source from the content-addressed store, hash-verified

135
136
137def get_parameter_groups(model, config):
138 skip = {}
139 skip_keywords = {}
140 if hasattr(model, 'no_weight_decay'):
141 skip = model.no_weight_decay()
142 if hasattr(model, 'no_weight_decay_keywords'):
143 skip_keywords = model.no_weight_decay_keywords()
144
145 parameters = set_weight_decay_and_lr(
146 model,
147 config.TRAIN.WEIGHT_DECAY,
148 config.TRAIN.BASE_LR,
149 skip,
150 skip_keywords,
151 lr_layer_decay=config.TRAIN.LR_LAYER_DECAY,
152 lr_layer_decay_ratio=config.TRAIN.LR_LAYER_DECAY_RATIO,
153 freeze_backbone=config.TRAIN.OPTIMIZER.FREEZE_BACKBONE,
154 dcn_lr_mul=config.TRAIN.OPTIMIZER.DCN_LR_MUL,
155 )
156 return parameters
157
158
159def get_optimizer_state_str(optimizer):

Callers 1

trainFunction · 0.85

Calls 1

set_weight_decay_and_lrFunction · 0.90

Tested by

no test coverage detected