-
Notifications
You must be signed in to change notification settings - Fork 2
/
levels.py
93 lines (82 loc) · 2.32 KB
/
levels.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from dataclasses import dataclass
@dataclass
class InnerLevel:
"""Inner CLEVA-Compass level with method attributes."""
multiple_models: int
federated: int
online: int
open_world: int
multiple_modalities: int
active_data_query: int
task_order_discovery: int
task_agnostic: int
episodic_memory: int
generative: int
uncertainty: int
def __iter__(self):
"""
Defines the iteration order. This needs to be the same order as defined in the
cleva_template.tex file.
"""
for item in [
self.multiple_models,
self.federated,
self.online,
self.open_world,
self.multiple_modalities,
self.active_data_query,
self.task_order_discovery,
self.task_agnostic,
self.episodic_memory,
self.generative,
self.uncertainty,
]:
yield item
@dataclass
class OuterLevel:
"""Outer CLEVA-Compass level with measurement attributes."""
compute_time: bool
mac_operations: bool
communication: bool
forgetting: bool
forward_transfer: bool
backward_transfer: bool
openness: bool
parameters: bool
memory: bool
stored_data: bool
generated_data: bool
optimization_steps: bool
per_task_metric: bool
task_order: bool
data_per_task: bool
def __iter__(self):
"""
Defines the iteration order. This needs to be the same order as defined in the
cleva_template.tex file.
"""
for item in [
self.parameters,
self.compute_time,
self.mac_operations,
self.communication,
self.forgetting,
self.forward_transfer,
self.backward_transfer,
self.openness,
self.data_per_task,
self.task_order,
self.per_task_metric,
self.optimization_steps,
self.generated_data,
self.stored_data,
self.memory,
]:
yield item
@dataclass
class CompassEntry:
"""Compass entry containing color, label, and attributes."""
color: str # Color, can be one of [magenta, green, blue, orange, cyan, brown]
label: str # Legend label
inner_level: InnerLevel
outer_level: OuterLevel