MCPcopy
hub / github.com/jindongwang/transferlearning / adv_eval

Method adv_eval

code/deep/ReMoS/CV_backdoor/finetuner.py:68–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 )
67
68 def adv_eval(self):
69 model = self.model
70 args = self.args
71 clean_top1, adv_top1, adv_sr = self.adv_eval_fn(model)
72 result_sum = 'Clean Top-1: {:.2f} | Adv Top-1: {:.2f} | Attack Success Rate: {:.2f}'.format(clean_top1,
73 adv_top1, adv_sr)
74 with open(osp.join(args.output_dir, "posttrain_eval.txt"), "w") as f:
75 f.write(result_sum)
76
77 def compute_loss(
78 self, batch, label, ce,

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected