MCPcopy Create free account
hub / github.com/Walter0807/MotionBERT / partial_train_layers

Function partial_train_layers

lib/utils/learning.py:69–77  ·  view source on GitHub ↗

Train partial layers of a given model.

(model, partial_list)

Source from the content-addressed store, hash-verified

67 return model
68
69def partial_train_layers(model, partial_list):
70 """Train partial layers of a given model."""
71 for name, p in model.named_parameters():
72 p.requires_grad = False
73 for trainable in partial_list:
74 if trainable in name:
75 p.requires_grad = True
76 break
77 return model
78
79def load_backbone(args):
80 if not(hasattr(args, "backbone")):

Callers 4

train_with_configFunction · 0.85
train_with_configFunction · 0.85
train_with_configFunction · 0.85
train_with_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected