Repository navigation
Expand file tree
/
Copy patharguments.py
More file actions
145 lines (122 loc) · 3.44 KB
/
Copy patharguments.py
File metadata and controls
145 lines (122 loc) · 3.44 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import argparse
VIT_NAME = [
"laion/CLIP-ViT-B-32-laion2B-s34B-b79K",
"laion/CLIP-ViT-B-16-laion2B-s34B-b88K",
"laion/CLIP-ViT-L-14-laion2B-s32B-b82K",
"laion/CLIP-ViT-H-14-laion2B-s32B-b79K",
"facebook/dinov2-small",
"facebook/dinov2-base",
"facebook/dinov2-large",
"google/siglip2-so400m-patch14-224",
"facebook/vit-mae-base",
"facebook/vit-mae-large",
"facebook/vit-mae-huge",
]
def parse_args():
parser = argparse.ArgumentParser(description="Time Vision Transformer.")
parser.add_argument(
"--vit_1_name",
type=str,
choices=VIT_NAME,
help="Pretrained weights of vision backbone",
)
parser.add_argument(
"--vit_2_name",
type=str,
choices=VIT_NAME,
help="Pretrained weights of vision backbone",
)
parser.add_argument(
"--vit_1_layer",
type=int,
help="Layer of vision backbone from which we extract representations",
)
parser.add_argument(
"--vit_2_layer",
type=int,
help="Layer of vision backbone from which we extract representations",
)
parser.add_argument(
"--mantis",
action="store_true",
help="Use time series foundation model Mantis",
)
parser.add_argument(
"--moment",
type=str,
choices=["small", "base", "large"],
help="Use time series foundation model MOMENT",
)
parser.add_argument(
"--aggregation",
type=str,
help="Aggregation of hidden representations",
)
parser.add_argument(
"--patch_size",
type=str,
choices=["sqrt", "linspace"],
help="How to find the patch size for 2D segmentation",
)
parser.add_argument(
"--stride",
type=float,
help="Stride as a fraction of patch size",
)
parser.add_argument(
"--classifier_type",
type=str,
choices=[
"logistic_regression",
"nearest_centroid",
"random_forest",
],
help="Classifier type",
)
parser.add_argument(
"--datasets",
type=str,
choices=["ucr", "uea"],
help="Time series classification benchmark",
)
parser.add_argument(
"--batch_size", type=int, default=128, help="Batch size for dataloader"
)
parser.add_argument(
"--aeon",
action="store_true",
help="Activate aeon data preprocessing",
)
parser.add_argument(
"--data_dir",
type=str,
required=True,
help="Path to the directory where datasets are stored",
)
parser.add_argument(
"--result_dir",
type=str,
required=True,
help="Path to the directory where results are stored",
)
parser.add_argument(
"--measure_alignment",
action="store_true",
help="Measure the alignment of model representations",
)
parser.add_argument(
"--get_intrinsic_dimension",
action="store_true",
help="Compute the intrinsic dimension of representations",
)
parser.add_argument(
"--get_principal_components",
action="store_true",
help="Compute the number of principal components required to cover 95 percent of the representation variance",
)
parser.add_argument(
"--random_seed",
type=int,
help="Change random seed for experiments",
)
return parser.parse_args()