Accuracy

class olympus.metrics.accuracy.AUC(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, aucs: list = <factory>, pccs: list = <factory>, name: str = 'validation', eval_time: olympus.utils.stat.StatStream = <factory>, total_time: int = 0, metric_stream: <function Stream at 0x7f737ccfe950> = <factory>)[source]

Bases: olympus.observers.observer.Observer

Attributes:
loader

Methods

every(*args[, epoch, batch]) Define how often this metric should be called
load_state_dict(state_dict) Load a state dictionary to resume a previous training
on_end_train(task[, step]) Called at the end of training after the last epoch
on_new_batch(task, step[, input, context]) Called after a batch has been processed
on_new_epoch(task, epoch, context) Called at the end of an epoch, before a new epoch starts
on_new_trial(task, step, parameters, uid) Called after a trial has been processed
on_start_train(task[, step]) Called on ce the training starts
state_dict() Return a state dictionary used to checkpointing and resuming
value() Return the key values that metrics computes
compute_auc  
get_auc  
on_end_epoch  
compute_auc(task)[source]
frequency_new_batch = 0
frequency_new_epoch = 1
get_auc(task, epoch, context)[source]
load_state_dict(state_dict)[source]

Load a state dictionary to resume a previous training

loader = None
name = 'validation'
on_end_epoch(task, epoch, context)[source]
on_end_train(task, step=None)[source]

Called at the end of training after the last epoch

on_start_train(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

state_dict()[source]

Return a state dictionary used to checkpointing and resuming

total_time = 0
value()[source]

Return the key values that metrics computes

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 0x7f737ccfe950> = <factory>)[source]

Bases: olympus.observers.observer.Observer

Attributes:
loader

Methods

every(*args[, epoch, batch]) Define how often this metric should be called
load_state_dict(state_dict) Load a state dictionary to resume a previous training
on_end_train(task[, step]) Called at the end of training after the last epoch
on_new_batch(task, step[, input, context]) Called after a batch has been processed
on_new_epoch(task, epoch, context) Called at the end of an epoch, before a new epoch starts
on_new_trial(task, step, parameters, uid) Called after a trial has been processed
on_start_train(task[, step]) Called on ce the training starts
state_dict() Return a state dictionary used to checkpointing and resuming
value() Return the key values that metrics computes
compute_accuracy  
get_accuracy  
on_end_epoch  
compute_accuracy(task)[source]
frequency_new_batch = 0
frequency_new_epoch = 1
get_accuracy(task, epoch, context)[source]
load_state_dict(state_dict)[source]

Load a state dictionary to resume a previous training

loader = None
name = 'validation'
on_end_epoch(task, epoch, context)[source]
on_end_train(task, step=None)[source]

Called at the end of training after the last epoch

on_new_trial(task, step, parameters, uid)[source]

Called after a trial has been processed

on_start_train(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

state_dict()[source]

Return a state dictionary used to checkpointing and resuming

total_time = 0
value()[source]

Return the key values that metrics computes

exception olympus.metrics.accuracy.NotFittedError[source]

Bases: Exception

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.Observer

Reuse 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(*args[, epoch, batch]) Define how often this metric should be called
load_state_dict(state_dict) Load a state dictionary to resume a previous training
on_end_train(task[, step]) Called at the end of training after the last epoch
on_new_batch(task, step[, input, context]) Called after a batch has been processed
on_new_epoch(task, epoch, context) Called at the end of an epoch, before a new epoch starts
on_new_trial(task, step, parameters, uid) Called after a trial has been processed
on_start_train(task[, step]) Called on ce the training starts
state_dict() Return a state dictionary used to checkpointing and resuming
value() 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
load_state_dict(state_dict)[source]

Load a state dictionary to resume a previous training

loss = 0
on_end_batch(task, step, input, context)[source]
on_end_epoch(task, epoch, context)[source]
on_end_train(task, step=None)[source]

Called at the end of training after the last epoch

state_dict()[source]

Return a state dictionary used to checkpointing and resuming

value()[source]

Return the key values that metrics computes

olympus.metrics.accuracy.detach(f)[source]
olympus.metrics.accuracy.item(f)[source]