Accuracy¶
-
class
olympus.metrics.accuracy.Accuracy(frequency_new_epoch: int = 1, frequency_new_batch: int = 0, frequency_new_trial: int = 0, priority: int = 0, loader: torch.utils.data.dataloader.DataLoader = None, accuracies: list = <factory>, losses: list = <factory>, name: str = 'validation', eval_time: olympus.utils.stat.StatStream = <factory>, total_time: int = 0, metric_stream: <function Stream at 0x7f68e07942f0> = <factory>)[source]¶ Bases:
olympus.observers.observer.ObserverAttributes: - loader
Methods
every(self, \*args[, epoch, batch])Define how often this metric should be called load_state_dict(self, state_dict)Load a state dictionary to resume a previous training on_end_train(self, task[, step])Called at the end of training after the last epoch on_new_batch(self, task, step[, input, context])Called after a batch has been processed on_new_epoch(self, task, epoch, context)Called at the end of an epoch, before a new epoch starts on_new_trial(self, task, step, parameters, uid)Called after a trial has been processed on_start_train(self, task[, step])Called on ce the training starts state_dict(self)Return a state dictionary used to checkpointing and resuming value(self)Return the key values that metrics computes compute_accuracy -
frequency_new_batch= 0¶
-
frequency_new_epoch= 1¶
-
loader= None¶
-
name= 'validation'¶
-
on_new_epoch(self, task, epoch, context)[source]¶ Called at the end of an epoch, before a new epoch starts
-
on_start_train(self, task, step=None)[source]¶ Called on ce the training starts
Notes
You should not rely on this function to initialize your metric as it will not be called if the training is resumed from a previous state
-
total_time= 0¶
-
class
olympus.metrics.accuracy.OnlineTrainAccuracy(frequency_new_epoch: int = 0, frequency_new_batch: int = 0, frequency_new_trial: int = 0, priority: int = 0, accuracies: list = <factory>, losses: list = <factory>, accumulator: int = 0, loss: int = 0, count: int = 0, frequency_end_epoch: int = 1, frequency_end_batch: int = 1) → None[source]¶ Bases:
olympus.observers.observer.ObserverReuse precomputed loss and prediction to get accuracy because the model is updated in between each batch, this does not return the true accuracy on the training set,
Methods
every(self, \*args[, epoch, batch])Define how often this metric should be called load_state_dict(self, state_dict)Load a state dictionary to resume a previous training on_end_train(self, task[, step])Called at the end of training after the last epoch on_new_batch(self, task, step[, input, context])Called after a batch has been processed on_new_epoch(self, task, epoch, context)Called at the end of an epoch, before a new epoch starts on_new_trial(self, task, step, parameters, uid)Called after a trial has been processed on_start_train(self, task[, step])Called on ce the training starts state_dict(self)Return a state dictionary used to checkpointing and resuming value(self)Return the key values that metrics computes on_end_batch on_end_epoch -
accumulator= 0¶
-
count= 0¶
-
frequency_end_batch= 1¶
-
frequency_end_epoch= 1¶
-
loss= 0¶
-