File size: 203 Bytes
5004324
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
def freeze(model):
    for p in model.parameters():
        p.requires_grad = False
    return model

def unfreeze(model):
    for p in model.parameters():
        p.requires_grad = True
    return model