avalanche.benchmarks.utils.TaskSet

class avalanche.benchmarks.utils.TaskSet(data: AvalancheDataset)[source]

A lazy mapping for <task-label -> task dataset>.

Given an AvalancheClassificationDataset, this class provides an iterator that splits the data into task subsets, returning tuples <task_id, task_dataset>.

Usage:

tset = TaskSet(data)
for tid, tdata in tset:
    print(f"task {tid} has {len(tdata)} examples.")
__init__(data: AvalancheDataset)[source]

Constructor.

Parameters:

data – original data

Methods

__init__(data)

Constructor.

get(k[,d])

items()

keys()

values()