|
30 | 30 | },
|
31 | 31 | {
|
32 | 32 | "cell_type": "code",
|
33 |
| - "execution_count": 1, |
| 33 | + "execution_count": null, |
34 | 34 | "id": "31f8ad6a",
|
35 | 35 | "metadata": {},
|
36 | 36 | "outputs": [],
|
|
68 | 68 | },
|
69 | 69 | {
|
70 | 70 | "cell_type": "code",
|
71 |
| - "execution_count": 2, |
| 71 | + "execution_count": null, |
72 | 72 | "id": "669a9877-adc2-4741-b291-2ff0d5a11396",
|
73 | 73 | "metadata": {},
|
74 | 74 | "outputs": [],
|
|
124 | 124 | },
|
125 | 125 | {
|
126 | 126 | "cell_type": "code",
|
127 |
| - "execution_count": 3, |
| 127 | + "execution_count": null, |
128 | 128 | "id": "0fe92ca6",
|
129 | 129 | "metadata": {},
|
130 |
| - "outputs": [ |
131 |
| - { |
132 |
| - "data": { |
133 |
| - "text/html": [ |
134 |
| - "<div>\n", |
135 |
| - "<style scoped>\n", |
136 |
| - " .dataframe tbody tr th:only-of-type {\n", |
137 |
| - " vertical-align: middle;\n", |
138 |
| - " }\n", |
139 |
| - "\n", |
140 |
| - " .dataframe tbody tr th {\n", |
141 |
| - " vertical-align: top;\n", |
142 |
| - " }\n", |
143 |
| - "\n", |
144 |
| - " .dataframe thead th {\n", |
145 |
| - " text-align: right;\n", |
146 |
| - " }\n", |
147 |
| - "</style>\n", |
148 |
| - "<table border=\"1\" class=\"dataframe\">\n", |
149 |
| - " <thead>\n", |
150 |
| - " <tr style=\"text-align: right;\">\n", |
151 |
| - " <th></th>\n", |
152 |
| - " <th>full_path</th>\n", |
153 |
| - " <th>file_name</th>\n", |
154 |
| - " <th>N_samples</th>\n", |
155 |
| - " </tr>\n", |
156 |
| - " </thead>\n", |
157 |
| - " <tbody>\n", |
158 |
| - " <tr>\n", |
159 |
| - " <th>0</th>\n", |
160 |
| - " <td>Simulated_EEG/1_10_1_1.pickle</td>\n", |
161 |
| - " <td>1_10_1_1.pickle</td>\n", |
162 |
| - " <td>15</td>\n", |
163 |
| - " </tr>\n", |
164 |
| - " <tr>\n", |
165 |
| - " <th>1</th>\n", |
166 |
| - " <td>Simulated_EEG/1_10_2_1.pickle</td>\n", |
167 |
| - " <td>1_10_2_1.pickle</td>\n", |
168 |
| - " <td>5</td>\n", |
169 |
| - " </tr>\n", |
170 |
| - " <tr>\n", |
171 |
| - " <th>2</th>\n", |
172 |
| - " <td>Simulated_EEG/1_10_3_1.pickle</td>\n", |
173 |
| - " <td>1_10_3_1.pickle</td>\n", |
174 |
| - " <td>7</td>\n", |
175 |
| - " </tr>\n", |
176 |
| - " <tr>\n", |
177 |
| - " <th>3</th>\n", |
178 |
| - " <td>Simulated_EEG/1_10_4_1.pickle</td>\n", |
179 |
| - " <td>1_10_4_1.pickle</td>\n", |
180 |
| - " <td>12</td>\n", |
181 |
| - " </tr>\n", |
182 |
| - " <tr>\n", |
183 |
| - " <th>4</th>\n", |
184 |
| - " <td>Simulated_EEG/1_10_5_1.pickle</td>\n", |
185 |
| - " <td>1_10_5_1.pickle</td>\n", |
186 |
| - " <td>6</td>\n", |
187 |
| - " </tr>\n", |
188 |
| - " </tbody>\n", |
189 |
| - "</table>\n", |
190 |
| - "</div>" |
191 |
| - ], |
192 |
| - "text/plain": [ |
193 |
| - " full_path file_name N_samples\n", |
194 |
| - "0 Simulated_EEG/1_10_1_1.pickle 1_10_1_1.pickle 15\n", |
195 |
| - "1 Simulated_EEG/1_10_2_1.pickle 1_10_2_1.pickle 5\n", |
196 |
| - "2 Simulated_EEG/1_10_3_1.pickle 1_10_3_1.pickle 7\n", |
197 |
| - "3 Simulated_EEG/1_10_4_1.pickle 1_10_4_1.pickle 12\n", |
198 |
| - "4 Simulated_EEG/1_10_5_1.pickle 1_10_5_1.pickle 6" |
199 |
| - ] |
200 |
| - }, |
201 |
| - "execution_count": 3, |
202 |
| - "metadata": {}, |
203 |
| - "output_type": "execute_result" |
204 |
| - } |
205 |
| - ], |
| 130 | + "outputs": [], |
206 | 131 | "source": [
|
207 | 132 | "# Define partition spec\n",
|
208 | 133 | "eegpath = 'Simulated_EEG'\n",
|
|
265 | 190 | },
|
266 | 191 | {
|
267 | 192 | "cell_type": "code",
|
268 |
| - "execution_count": 4, |
| 193 | + "execution_count": null, |
269 | 194 | "id": "aabf2f21",
|
270 | 195 | "metadata": {},
|
271 |
| - "outputs": [ |
272 |
| - { |
273 |
| - "name": "stdout", |
274 |
| - "output_type": "stream", |
275 |
| - "text": [ |
276 |
| - "\n", |
277 |
| - "train ratio: 0.80\n", |
278 |
| - "validation ratio: 0.10\n", |
279 |
| - "test ratio: 0.10\n", |
280 |
| - "\n", |
281 |
| - "train labels ratio: 1=0.239, 2=0.244, 3=0.252, 4=0.265, \n", |
282 |
| - "val labels ratio: 1=0.239, 2=0.244, 3=0.252, 4=0.265, \n", |
283 |
| - "test labels ratio: 1=0.239, 2=0.244, 3=0.252, 4=0.265, \n", |
284 |
| - "\n" |
285 |
| - ] |
286 |
| - } |
287 |
| - ], |
| 196 | + "outputs": [], |
288 | 197 | "source": [
|
289 | 198 | "# for stratified split we need to create an array with the labels\n",
|
290 | 199 | "# associated to each eeg file\n",
|
|
313 | 222 | },
|
314 | 223 | {
|
315 | 224 | "cell_type": "code",
|
316 |
| - "execution_count": 5, |
| 225 | + "execution_count": null, |
317 | 226 | "id": "80f99b9f-a634-4e1c-90cd-10c30f5c20ae",
|
318 | 227 | "metadata": {},
|
319 |
| - "outputs": [ |
320 |
| - { |
321 |
| - "name": "stdout", |
322 |
| - "output_type": "stream", |
323 |
| - "text": [ |
324 |
| - "\n", |
325 |
| - "train ratio: 0.80\n", |
326 |
| - "validation ratio: 0.10\n", |
327 |
| - "test ratio: 0.10\n" |
328 |
| - ] |
329 |
| - } |
330 |
| - ], |
| 228 | + "outputs": [], |
331 | 229 | "source": [
|
332 | 230 | "EEGsplit2 = dl.GetEEGSplitTable(EEGlen, \n",
|
333 | 231 | " test_ratio=0.1, val_ratio=0.1,\n",
|
|
388 | 286 | },
|
389 | 287 | {
|
390 | 288 | "cell_type": "code",
|
391 |
| - "execution_count": 6, |
| 289 | + "execution_count": null, |
392 | 290 | "id": "80f58518",
|
393 | 291 | "metadata": {},
|
394 |
| - "outputs": [ |
395 |
| - { |
396 |
| - "name": "stdout", |
397 |
| - "output_type": "stream", |
398 |
| - "text": [ |
399 |
| - "torch.Size([2, 256])\n" |
400 |
| - ] |
401 |
| - } |
402 |
| - ], |
| 292 | + "outputs": [], |
403 | 293 | "source": [
|
404 | 294 | "dataset_pretrain = dl.EEGDataset(EEGlen, EEGsplit, \n",
|
405 | 295 | " [freq, window, overlap], # split parameters must be given as list\n",
|
|
421 | 311 | },
|
422 | 312 | {
|
423 | 313 | "cell_type": "code",
|
424 |
| - "execution_count": 7, |
| 314 | + "execution_count": null, |
425 | 315 | "id": "914261e4",
|
426 | 316 | "metadata": {},
|
427 |
| - "outputs": [ |
428 |
| - { |
429 |
| - "name": "stdout", |
430 |
| - "output_type": "stream", |
431 |
| - "text": [ |
432 |
| - "torch.Size([2, 256]) 1\n" |
433 |
| - ] |
434 |
| - } |
435 |
| - ], |
| 317 | + "outputs": [], |
436 | 318 | "source": [
|
437 | 319 | "dataset_finetune = dl.EEGDataset(EEGlen, EEGsplit, \n",
|
438 | 320 | " [freq, window, overlap], # split parameters must be given as list\n",
|
|
474 | 356 | },
|
475 | 357 | {
|
476 | 358 | "cell_type": "code",
|
477 |
| - "execution_count": 8, |
| 359 | + "execution_count": null, |
478 | 360 | "id": "abdbddd5-346b-4b5d-860b-2e3459b41646",
|
479 | 361 | "metadata": {},
|
480 | 362 | "outputs": [],
|
|
499 | 381 | },
|
500 | 382 | {
|
501 | 383 | "cell_type": "code",
|
502 |
| - "execution_count": 9, |
| 384 | + "execution_count": null, |
503 | 385 | "id": "57c84ba5-1bd9-4403-92ed-b7c3f791d6bc",
|
504 | 386 | "metadata": {},
|
505 |
| - "outputs": [ |
506 |
| - { |
507 |
| - "name": "stdout", |
508 |
| - "output_type": "stream", |
509 |
| - "text": [ |
510 |
| - "torch.Size([16, 2, 256])\n" |
511 |
| - ] |
512 |
| - } |
513 |
| - ], |
| 387 | + "outputs": [], |
514 | 388 | "source": [
|
515 | 389 | "Final_Dataloader = DataLoader( dataset = dataset_pretrain, \n",
|
516 | 390 | " batch_size= 16, \n",
|
|
0 commit comments