MCPcopy Create free account
hub / github.com/CausalLearning/robust-unlearnable-examples / load_pretrained_model

Function load_pretrained_model

generate_robust_em.py:51–56  ·  view source on GitHub ↗
(model, arch, pre_state_dict)

Source from the content-addressed store, hash-verified

49
50
51def load_pretrained_model(model, arch, pre_state_dict):
52 target_state_dict = model.state_dict()
53
54 for name, param in pre_state_dict.items():
55 if (arch=='resnet18') and ('linear' in name): continue
56 target_state_dict[name].copy_(param)
57
58
59def regenerate_def_noise(def_noise, model, criterion, loader, defender, cpu):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected