MCPcopy Create free account
hub / github.com/cure-lab/deep-active-learning / update

Method update

utils.py:61–69  ·  view source on GitHub ↗
(self, idx, train_loss, train_acc, val_loss, val_acc)

Source from the content-addressed store, hash-verified

59 self.epoch_accuracy = self.epoch_accuracy
60
61 def update(self, idx, train_loss, train_acc, val_loss, val_acc):
62 assert idx >= 0 and idx < self.total_epoch, 'total_epoch : {} , but update with the {} index'.format(
63 self.total_epoch, idx)
64 self.epoch_losses[idx, 0] = train_loss
65 self.epoch_losses[idx, 1] = val_loss
66 self.epoch_accuracy[idx, 0] = train_acc
67 self.epoch_accuracy[idx, 1] = val_acc
68 self.current_epoch = idx + 1
69 # return self.max_accuracy(False) == val_acc
70
71 def max_accuracy(self, istrain):
72 if self.current_epoch <= 0: return 0

Callers 11

trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95
trainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected