-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsetting.py
31 lines (22 loc) · 1.18 KB
/
setting.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
""" Defines the Task-Incremental CL Setting.
Task-Incremental CL is a variant of the ClassIncrementalSetting with task labels
available at both train and test time.
"""
from dataclasses import dataclass
from typing import ClassVar, Type, TypeVar
from sequoia.settings.assumptions.task_incremental import TaskIncrementalAssumption
from sequoia.settings.sl.incremental import IncrementalSLResults as TaskIncrementalSLResults
from sequoia.settings.sl.incremental import IncrementalSLSetting
from sequoia.utils.utils import constant
@dataclass
class TaskIncrementalSLSetting(TaskIncrementalAssumption, IncrementalSLSetting):
"""Setting where data arrives in a series of Tasks, and where the task
labels are always available (both train and test time).
"""
Results: ClassVar[Type[Results]] = TaskIncrementalSLResults
# Wether task labels are available at train time. (Forced to True.)
task_labels_at_train_time: bool = constant(True)
# Wether task labels are available at test time.
# TODO: Is this really always True for all Task-Incremental Settings?
task_labels_at_test_time: bool = constant(True)
SettingType = TypeVar("SettingType", bound=TaskIncrementalSLSetting)