BUFFER LWS#
Custom buffer for Learning without Shortcuts (LwS).
Classes#
- class utils.buffer_lws.Buffer(buffer_size, device, n_tasks, attributes=['examples', 'labels', 'logits', 'task_labels'], n_bin=8)[source]#
Bases:
Dataset
- add_data(examples, labels=None, clusters_labels=None, logits=None, clusters_logits=None, task_labels=None, loss_values=None)[source]#
- init_tensors(examples, labels, logits, task_labels, clusters_labels=None, clusters_logits=None, loss_values=None)[source]#
- reservoir_bin_loss(loss_value)[source]#
Modified reservoir sampling algorithm considering loss values and binning.
- Return type:
- reservoir_loss(num_seen_examples, buffer_size, loss_value)[source]#
Modified reservoir sampling algorithm considering loss values
- Return type: