MCPcopy Create free account
hub / github.com/TPCD/DCCL / evaluate

Method evaluate

project_utils/general_utils.py:271–278  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

269 torch.save(self.all_labels, self.save_path + '_labels.pth')
270
271 def evaluate(self):
272
273 topk = [1, 5, 10]
274 topk = [k for k in topk if k < self.all_preds.shape[-1]]
275 acc = accuracy(torch.from_numpy(self.all_preds), torch.from_numpy(self.all_labels), topk=topk)
276
277 for k, a in zip(topk, acc):
278 print(f'Top{k} Acc: {a.item()}')
279
280
281def get_acc_auroc_curves(logdir):

Callers 1

saveMethod · 0.95

Calls 1

accuracyFunction · 0.70

Tested by

no test coverage detected