semihdervis commited on
Commit
e327818
1 Parent(s): 33c98a8

Upload 9 files

Browse files
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ model.safetensors filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ base_model: google/vit-base-patch16-224-in21k
5
+ tags:
6
+ - image-classification
7
+ - generated_from_trainer
8
+ datasets:
9
+ - imagefolder
10
+ metrics:
11
+ - accuracy
12
+ model-index:
13
+ - name: vit-base-cat-emotions
14
+ results:
15
+ - task:
16
+ name: Image Classification
17
+ type: image-classification
18
+ dataset:
19
+ name: custom dataset
20
+ type: imagefolder
21
+ config: default
22
+ split: validation
23
+ args: default
24
+ metrics:
25
+ - name: Accuracy
26
+ type: accuracy
27
+ value: 0.6352941176470588
28
+ ---
29
+
30
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
31
+ should probably proofread and complete it, then remove this comment. -->
32
+
33
+ # vit-base-cat-emotions
34
+
35
+ This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on the custom dataset dataset.
36
+ It achieves the following results on the evaluation set:
37
+ - Loss: 1.0160
38
+ - Accuracy: 0.6353
39
+
40
+ ## Model description
41
+
42
+ More information needed
43
+
44
+ ## Intended uses & limitations
45
+
46
+ More information needed
47
+
48
+ ## Training and evaluation data
49
+
50
+ More information needed
51
+
52
+ ## Training procedure
53
+
54
+ ### Training hyperparameters
55
+
56
+ The following hyperparameters were used during training:
57
+ - learning_rate: 0.0002
58
+ - train_batch_size: 16
59
+ - eval_batch_size: 8
60
+ - seed: 42
61
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
62
+ - lr_scheduler_type: linear
63
+ - num_epochs: 10
64
+ - mixed_precision_training: Native AMP
65
+
66
+ ### Training results
67
+
68
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
69
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|
70
+ | 0.3361 | 3.125 | 100 | 1.0125 | 0.6548 |
71
+ | 0.0723 | 6.25 | 200 | 0.9043 | 0.7381 |
72
+ | 0.0321 | 9.375 | 300 | 0.9268 | 0.7143 |
73
+
74
+
75
+ ### Framework versions
76
+
77
+ - Transformers 4.44.1
78
+ - Pytorch 2.2.2+cu118
79
+ - Datasets 2.20.0
80
+ - Tokenizers 0.19.1
all_results.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 10.0,
3
+ "eval_accuracy": 0.6352941176470588,
4
+ "eval_loss": 1.0160140991210938,
5
+ "eval_runtime": 0.8405,
6
+ "eval_samples_per_second": 101.135,
7
+ "eval_steps_per_second": 13.088,
8
+ "total_flos": 3.8902722072367104e+17,
9
+ "train_loss": 0.3804276719689369,
10
+ "train_runtime": 80.487,
11
+ "train_samples_per_second": 62.37,
12
+ "train_steps_per_second": 3.976
13
+ }
config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "google/vit-base-patch16-224-in21k",
3
+ "architectures": [
4
+ "ViTForImageClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "encoder_stride": 16,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.0,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "Angry",
13
+ "1": "Disgusted",
14
+ "2": "Happy",
15
+ "3": "Normal",
16
+ "4": "Sad",
17
+ "5": "Scared",
18
+ "6": "Surprised"
19
+ },
20
+ "image_size": 224,
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 3072,
23
+ "label2id": {
24
+ "Angry": "0",
25
+ "Disgusted": "1",
26
+ "Happy": "2",
27
+ "Normal": "3",
28
+ "Sad": "4",
29
+ "Scared": "5",
30
+ "Surprised": "6"
31
+ },
32
+ "layer_norm_eps": 1e-12,
33
+ "model_type": "vit",
34
+ "num_attention_heads": 12,
35
+ "num_channels": 3,
36
+ "num_hidden_layers": 12,
37
+ "patch_size": 16,
38
+ "problem_type": "single_label_classification",
39
+ "qkv_bias": true,
40
+ "torch_dtype": "float32",
41
+ "transformers_version": "4.44.1"
42
+ }
eval_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 10.0,
3
+ "eval_accuracy": 0.6352941176470588,
4
+ "eval_loss": 1.0160140991210938,
5
+ "eval_runtime": 0.8405,
6
+ "eval_samples_per_second": 101.135,
7
+ "eval_steps_per_second": 13.088
8
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b3c31611713dbbae9d16eab86b5a0842e44001fd3c88afb11713f92f8266997
3
+ size 343239356
preprocessor_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_rescale": true,
4
+ "do_resize": true,
5
+ "image_mean": [
6
+ 0.5,
7
+ 0.5,
8
+ 0.5
9
+ ],
10
+ "image_processor_type": "ViTFeatureExtractor",
11
+ "image_std": [
12
+ 0.5,
13
+ 0.5,
14
+ 0.5
15
+ ],
16
+ "resample": 2,
17
+ "rescale_factor": 0.00392156862745098,
18
+ "size": {
19
+ "height": 224,
20
+ "width": 224
21
+ }
22
+ }
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 10.0,
3
+ "total_flos": 3.8902722072367104e+17,
4
+ "train_loss": 0.3804276719689369,
5
+ "train_runtime": 80.487,
6
+ "train_samples_per_second": 62.37,
7
+ "train_steps_per_second": 3.976
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.9043070673942566,
3
+ "best_model_checkpoint": "vit-base-cat-emotions\\checkpoint-200",
4
+ "epoch": 10.0,
5
+ "eval_steps": 100,
6
+ "global_step": 320,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.3125,
13
+ "grad_norm": 1.1178287267684937,
14
+ "learning_rate": 0.00019375000000000002,
15
+ "loss": 1.9108,
16
+ "step": 10
17
+ },
18
+ {
19
+ "epoch": 0.625,
20
+ "grad_norm": 2.2460951805114746,
21
+ "learning_rate": 0.0001875,
22
+ "loss": 1.815,
23
+ "step": 20
24
+ },
25
+ {
26
+ "epoch": 0.9375,
27
+ "grad_norm": 1.9426186084747314,
28
+ "learning_rate": 0.00018125000000000001,
29
+ "loss": 1.5822,
30
+ "step": 30
31
+ },
32
+ {
33
+ "epoch": 1.25,
34
+ "grad_norm": 2.800794839859009,
35
+ "learning_rate": 0.000175,
36
+ "loss": 1.3129,
37
+ "step": 40
38
+ },
39
+ {
40
+ "epoch": 1.5625,
41
+ "grad_norm": 3.274559497833252,
42
+ "learning_rate": 0.00016875,
43
+ "loss": 1.0768,
44
+ "step": 50
45
+ },
46
+ {
47
+ "epoch": 1.875,
48
+ "grad_norm": 2.4314801692962646,
49
+ "learning_rate": 0.00016250000000000002,
50
+ "loss": 0.9329,
51
+ "step": 60
52
+ },
53
+ {
54
+ "epoch": 2.1875,
55
+ "grad_norm": 1.755449891090393,
56
+ "learning_rate": 0.00015625,
57
+ "loss": 0.7257,
58
+ "step": 70
59
+ },
60
+ {
61
+ "epoch": 2.5,
62
+ "grad_norm": 2.522848129272461,
63
+ "learning_rate": 0.00015000000000000001,
64
+ "loss": 0.519,
65
+ "step": 80
66
+ },
67
+ {
68
+ "epoch": 2.8125,
69
+ "grad_norm": 1.7849164009094238,
70
+ "learning_rate": 0.00014375,
71
+ "loss": 0.4472,
72
+ "step": 90
73
+ },
74
+ {
75
+ "epoch": 3.125,
76
+ "grad_norm": 1.2824078798294067,
77
+ "learning_rate": 0.0001375,
78
+ "loss": 0.3361,
79
+ "step": 100
80
+ },
81
+ {
82
+ "epoch": 3.125,
83
+ "eval_accuracy": 0.6547619047619048,
84
+ "eval_loss": 1.0124708414077759,
85
+ "eval_runtime": 0.7491,
86
+ "eval_samples_per_second": 112.131,
87
+ "eval_steps_per_second": 14.684,
88
+ "step": 100
89
+ },
90
+ {
91
+ "epoch": 3.4375,
92
+ "grad_norm": 1.1555737257003784,
93
+ "learning_rate": 0.00013125000000000002,
94
+ "loss": 0.2081,
95
+ "step": 110
96
+ },
97
+ {
98
+ "epoch": 3.75,
99
+ "grad_norm": 0.7941139936447144,
100
+ "learning_rate": 0.000125,
101
+ "loss": 0.1453,
102
+ "step": 120
103
+ },
104
+ {
105
+ "epoch": 4.0625,
106
+ "grad_norm": 0.39761993288993835,
107
+ "learning_rate": 0.00011875,
108
+ "loss": 0.1842,
109
+ "step": 130
110
+ },
111
+ {
112
+ "epoch": 4.375,
113
+ "grad_norm": 0.4260774254798889,
114
+ "learning_rate": 0.00011250000000000001,
115
+ "loss": 0.0941,
116
+ "step": 140
117
+ },
118
+ {
119
+ "epoch": 4.6875,
120
+ "grad_norm": 0.2251412719488144,
121
+ "learning_rate": 0.00010625000000000001,
122
+ "loss": 0.0809,
123
+ "step": 150
124
+ },
125
+ {
126
+ "epoch": 5.0,
127
+ "grad_norm": 0.22556072473526,
128
+ "learning_rate": 0.0001,
129
+ "loss": 0.0827,
130
+ "step": 160
131
+ },
132
+ {
133
+ "epoch": 5.3125,
134
+ "grad_norm": 0.175390362739563,
135
+ "learning_rate": 9.375e-05,
136
+ "loss": 0.0643,
137
+ "step": 170
138
+ },
139
+ {
140
+ "epoch": 5.625,
141
+ "grad_norm": 0.18123513460159302,
142
+ "learning_rate": 8.75e-05,
143
+ "loss": 0.0652,
144
+ "step": 180
145
+ },
146
+ {
147
+ "epoch": 5.9375,
148
+ "grad_norm": 0.15588343143463135,
149
+ "learning_rate": 8.125000000000001e-05,
150
+ "loss": 0.0498,
151
+ "step": 190
152
+ },
153
+ {
154
+ "epoch": 6.25,
155
+ "grad_norm": 0.2110791653394699,
156
+ "learning_rate": 7.500000000000001e-05,
157
+ "loss": 0.0723,
158
+ "step": 200
159
+ },
160
+ {
161
+ "epoch": 6.25,
162
+ "eval_accuracy": 0.7380952380952381,
163
+ "eval_loss": 0.9043070673942566,
164
+ "eval_runtime": 0.7518,
165
+ "eval_samples_per_second": 111.725,
166
+ "eval_steps_per_second": 14.631,
167
+ "step": 200
168
+ },
169
+ {
170
+ "epoch": 6.5625,
171
+ "grad_norm": 0.1404016613960266,
172
+ "learning_rate": 6.875e-05,
173
+ "loss": 0.0442,
174
+ "step": 210
175
+ },
176
+ {
177
+ "epoch": 6.875,
178
+ "grad_norm": 0.13061176240444183,
179
+ "learning_rate": 6.25e-05,
180
+ "loss": 0.0529,
181
+ "step": 220
182
+ },
183
+ {
184
+ "epoch": 7.1875,
185
+ "grad_norm": 0.11943121254444122,
186
+ "learning_rate": 5.6250000000000005e-05,
187
+ "loss": 0.0381,
188
+ "step": 230
189
+ },
190
+ {
191
+ "epoch": 7.5,
192
+ "grad_norm": 0.11987230181694031,
193
+ "learning_rate": 5e-05,
194
+ "loss": 0.0422,
195
+ "step": 240
196
+ },
197
+ {
198
+ "epoch": 7.8125,
199
+ "grad_norm": 0.11512718349695206,
200
+ "learning_rate": 4.375e-05,
201
+ "loss": 0.0429,
202
+ "step": 250
203
+ },
204
+ {
205
+ "epoch": 8.125,
206
+ "grad_norm": 0.11094118654727936,
207
+ "learning_rate": 3.7500000000000003e-05,
208
+ "loss": 0.034,
209
+ "step": 260
210
+ },
211
+ {
212
+ "epoch": 8.4375,
213
+ "grad_norm": 0.10723838955163956,
214
+ "learning_rate": 3.125e-05,
215
+ "loss": 0.0339,
216
+ "step": 270
217
+ },
218
+ {
219
+ "epoch": 8.75,
220
+ "grad_norm": 0.11790188401937485,
221
+ "learning_rate": 2.5e-05,
222
+ "loss": 0.0425,
223
+ "step": 280
224
+ },
225
+ {
226
+ "epoch": 9.0625,
227
+ "grad_norm": 0.09828304499387741,
228
+ "learning_rate": 1.8750000000000002e-05,
229
+ "loss": 0.0331,
230
+ "step": 290
231
+ },
232
+ {
233
+ "epoch": 9.375,
234
+ "grad_norm": 0.09926401823759079,
235
+ "learning_rate": 1.25e-05,
236
+ "loss": 0.0321,
237
+ "step": 300
238
+ },
239
+ {
240
+ "epoch": 9.375,
241
+ "eval_accuracy": 0.7142857142857143,
242
+ "eval_loss": 0.926792323589325,
243
+ "eval_runtime": 0.7517,
244
+ "eval_samples_per_second": 111.752,
245
+ "eval_steps_per_second": 14.634,
246
+ "step": 300
247
+ },
248
+ {
249
+ "epoch": 9.6875,
250
+ "grad_norm": 0.10707634687423706,
251
+ "learning_rate": 6.25e-06,
252
+ "loss": 0.0404,
253
+ "step": 310
254
+ },
255
+ {
256
+ "epoch": 10.0,
257
+ "grad_norm": 0.1315452754497528,
258
+ "learning_rate": 0.0,
259
+ "loss": 0.0319,
260
+ "step": 320
261
+ },
262
+ {
263
+ "epoch": 10.0,
264
+ "step": 320,
265
+ "total_flos": 3.8902722072367104e+17,
266
+ "train_loss": 0.3804276719689369,
267
+ "train_runtime": 80.487,
268
+ "train_samples_per_second": 62.37,
269
+ "train_steps_per_second": 3.976
270
+ }
271
+ ],
272
+ "logging_steps": 10,
273
+ "max_steps": 320,
274
+ "num_input_tokens_seen": 0,
275
+ "num_train_epochs": 10,
276
+ "save_steps": 100,
277
+ "stateful_callbacks": {
278
+ "TrainerControl": {
279
+ "args": {
280
+ "should_epoch_stop": false,
281
+ "should_evaluate": false,
282
+ "should_log": false,
283
+ "should_save": true,
284
+ "should_training_stop": true
285
+ },
286
+ "attributes": {}
287
+ }
288
+ },
289
+ "total_flos": 3.8902722072367104e+17,
290
+ "train_batch_size": 16,
291
+ "trial_name": null,
292
+ "trial_params": null
293
+ }
training_args.bin ADDED
Binary file (5.18 kB). View file