└── Pytorch_Tutorial.ipynb /Pytorch_Tutorial.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Pytorch_Tutorial.ipynb", 7 | "provenance": [], 8 | "collapsed_sections": [], 9 | "authorship_tag": "ABX9TyN0DD9lfjDDJHNjBPyAfBlZ", 10 | "include_colab_link": true 11 | }, 12 | "kernelspec": { 13 | "name": "python3", 14 | "display_name": "Python 3" 15 | }, 16 | "language_info": { 17 | "name": "python" 18 | }, 19 | "accelerator": "GPU", 20 | "widgets": { 21 | "application/vnd.jupyter.widget-state+json": { 22 | "7fac7f3bf8014d36af131ba7fe6bc04d": { 23 | "model_module": "@jupyter-widgets/controls", 24 | "model_name": "HBoxModel", 25 | "model_module_version": "1.5.0", 26 | "state": { 27 | "_dom_classes": [], 28 | "_model_module": "@jupyter-widgets/controls", 29 | "_model_module_version": "1.5.0", 30 | "_model_name": "HBoxModel", 31 | "_view_count": null, 32 | "_view_module": "@jupyter-widgets/controls", 33 | "_view_module_version": "1.5.0", 34 | "_view_name": "HBoxView", 35 | "box_style": "", 36 | "children": [ 37 | "IPY_MODEL_a43e7698afbb4f33b94f7bc572761a35", 38 | "IPY_MODEL_d4a18ada25404ae0b0110d0e2ad9621e", 39 | "IPY_MODEL_68c82d6d0309489b9bb143ae22246949" 40 | ], 41 | "layout": "IPY_MODEL_37f00a01ae9843c3b4203d7adcf9f366" 42 | } 43 | }, 44 | "a43e7698afbb4f33b94f7bc572761a35": { 45 | "model_module": "@jupyter-widgets/controls", 46 | "model_name": "HTMLModel", 47 | "model_module_version": "1.5.0", 48 | "state": { 49 | "_dom_classes": [], 50 | "_model_module": "@jupyter-widgets/controls", 51 | "_model_module_version": "1.5.0", 52 | "_model_name": "HTMLModel", 53 | "_view_count": null, 54 | "_view_module": "@jupyter-widgets/controls", 55 | "_view_module_version": "1.5.0", 56 | "_view_name": "HTMLView", 57 | "description": "", 58 | "description_tooltip": null, 59 | "layout": "IPY_MODEL_95c26eaaabe84b298689ec2162e20c88", 60 | "placeholder": "​", 61 | "style": "IPY_MODEL_8f38acb6bf0646ae9d66948d6ad877ee", 62 | "value": "100%" 63 | } 64 | }, 65 | "d4a18ada25404ae0b0110d0e2ad9621e": { 66 | "model_module": "@jupyter-widgets/controls", 67 | "model_name": "FloatProgressModel", 68 | "model_module_version": "1.5.0", 69 | "state": { 70 | "_dom_classes": [], 71 | "_model_module": "@jupyter-widgets/controls", 72 | "_model_module_version": "1.5.0", 73 | "_model_name": "FloatProgressModel", 74 | "_view_count": null, 75 | "_view_module": "@jupyter-widgets/controls", 76 | "_view_module_version": "1.5.0", 77 | "_view_name": "ProgressView", 78 | "bar_style": "success", 79 | "description": "", 80 | "description_tooltip": null, 81 | "layout": "IPY_MODEL_51346874e02042ffb7747ff2c7aba8e4", 82 | "max": 3, 83 | "min": 0, 84 | "orientation": "horizontal", 85 | "style": "IPY_MODEL_b888fab607004a9d9915fa8ab08f1897", 86 | "value": 3 87 | } 88 | }, 89 | "68c82d6d0309489b9bb143ae22246949": { 90 | "model_module": "@jupyter-widgets/controls", 91 | "model_name": "HTMLModel", 92 | "model_module_version": "1.5.0", 93 | "state": { 94 | "_dom_classes": [], 95 | "_model_module": "@jupyter-widgets/controls", 96 | "_model_module_version": "1.5.0", 97 | "_model_name": "HTMLModel", 98 | "_view_count": null, 99 | "_view_module": "@jupyter-widgets/controls", 100 | "_view_module_version": "1.5.0", 101 | "_view_name": "HTMLView", 102 | "description": "", 103 | "description_tooltip": null, 104 | "layout": "IPY_MODEL_8452a8bd41ba432e9dc0315c85b18808", 105 | "placeholder": "​", 106 | "style": "IPY_MODEL_7465b89c8c5b46e28e220ad645b1a46a", 107 | "value": " 3/3 [00:00<00:00, 59.90it/s]" 108 | } 109 | }, 110 | "37f00a01ae9843c3b4203d7adcf9f366": { 111 | "model_module": "@jupyter-widgets/base", 112 | "model_name": "LayoutModel", 113 | "model_module_version": "1.2.0", 114 | "state": { 115 | "_model_module": "@jupyter-widgets/base", 116 | "_model_module_version": "1.2.0", 117 | "_model_name": "LayoutModel", 118 | "_view_count": null, 119 | "_view_module": "@jupyter-widgets/base", 120 | "_view_module_version": "1.2.0", 121 | "_view_name": "LayoutView", 122 | "align_content": null, 123 | "align_items": null, 124 | "align_self": null, 125 | "border": null, 126 | "bottom": null, 127 | "display": null, 128 | "flex": null, 129 | "flex_flow": null, 130 | "grid_area": null, 131 | "grid_auto_columns": null, 132 | "grid_auto_flow": null, 133 | "grid_auto_rows": null, 134 | "grid_column": null, 135 | "grid_gap": null, 136 | "grid_row": null, 137 | "grid_template_areas": null, 138 | "grid_template_columns": null, 139 | "grid_template_rows": null, 140 | "height": null, 141 | "justify_content": null, 142 | "justify_items": null, 143 | "left": null, 144 | "margin": null, 145 | "max_height": null, 146 | "max_width": null, 147 | "min_height": null, 148 | "min_width": null, 149 | "object_fit": null, 150 | "object_position": null, 151 | "order": null, 152 | "overflow": null, 153 | "overflow_x": null, 154 | "overflow_y": null, 155 | "padding": null, 156 | "right": null, 157 | "top": null, 158 | "visibility": null, 159 | "width": null 160 | } 161 | }, 162 | "95c26eaaabe84b298689ec2162e20c88": { 163 | "model_module": "@jupyter-widgets/base", 164 | "model_name": "LayoutModel", 165 | "model_module_version": "1.2.0", 166 | "state": { 167 | "_model_module": "@jupyter-widgets/base", 168 | "_model_module_version": "1.2.0", 169 | "_model_name": "LayoutModel", 170 | "_view_count": null, 171 | "_view_module": "@jupyter-widgets/base", 172 | "_view_module_version": "1.2.0", 173 | "_view_name": "LayoutView", 174 | "align_content": null, 175 | "align_items": null, 176 | "align_self": null, 177 | "border": null, 178 | "bottom": null, 179 | "display": null, 180 | "flex": null, 181 | "flex_flow": null, 182 | "grid_area": null, 183 | "grid_auto_columns": null, 184 | "grid_auto_flow": null, 185 | "grid_auto_rows": null, 186 | "grid_column": null, 187 | "grid_gap": null, 188 | "grid_row": null, 189 | "grid_template_areas": null, 190 | "grid_template_columns": null, 191 | "grid_template_rows": null, 192 | "height": null, 193 | "justify_content": null, 194 | "justify_items": null, 195 | "left": null, 196 | "margin": null, 197 | "max_height": null, 198 | "max_width": null, 199 | "min_height": null, 200 | "min_width": null, 201 | "object_fit": null, 202 | "object_position": null, 203 | "order": null, 204 | "overflow": null, 205 | "overflow_x": null, 206 | "overflow_y": null, 207 | "padding": null, 208 | "right": null, 209 | "top": null, 210 | "visibility": null, 211 | "width": null 212 | } 213 | }, 214 | "8f38acb6bf0646ae9d66948d6ad877ee": { 215 | "model_module": "@jupyter-widgets/controls", 216 | "model_name": "DescriptionStyleModel", 217 | "model_module_version": "1.5.0", 218 | "state": { 219 | "_model_module": "@jupyter-widgets/controls", 220 | "_model_module_version": "1.5.0", 221 | "_model_name": "DescriptionStyleModel", 222 | "_view_count": null, 223 | "_view_module": "@jupyter-widgets/base", 224 | "_view_module_version": "1.2.0", 225 | "_view_name": "StyleView", 226 | "description_width": "" 227 | } 228 | }, 229 | "51346874e02042ffb7747ff2c7aba8e4": { 230 | "model_module": "@jupyter-widgets/base", 231 | "model_name": "LayoutModel", 232 | "model_module_version": "1.2.0", 233 | "state": { 234 | "_model_module": "@jupyter-widgets/base", 235 | "_model_module_version": "1.2.0", 236 | "_model_name": "LayoutModel", 237 | "_view_count": null, 238 | "_view_module": "@jupyter-widgets/base", 239 | "_view_module_version": "1.2.0", 240 | "_view_name": "LayoutView", 241 | "align_content": null, 242 | "align_items": null, 243 | "align_self": null, 244 | "border": null, 245 | "bottom": null, 246 | "display": null, 247 | "flex": null, 248 | "flex_flow": null, 249 | "grid_area": null, 250 | "grid_auto_columns": null, 251 | "grid_auto_flow": null, 252 | "grid_auto_rows": null, 253 | "grid_column": null, 254 | "grid_gap": null, 255 | "grid_row": null, 256 | "grid_template_areas": null, 257 | "grid_template_columns": null, 258 | "grid_template_rows": null, 259 | "height": null, 260 | "justify_content": null, 261 | "justify_items": null, 262 | "left": null, 263 | "margin": null, 264 | "max_height": null, 265 | "max_width": null, 266 | "min_height": null, 267 | "min_width": null, 268 | "object_fit": null, 269 | "object_position": null, 270 | "order": null, 271 | "overflow": null, 272 | "overflow_x": null, 273 | "overflow_y": null, 274 | "padding": null, 275 | "right": null, 276 | "top": null, 277 | "visibility": null, 278 | "width": null 279 | } 280 | }, 281 | "b888fab607004a9d9915fa8ab08f1897": { 282 | "model_module": "@jupyter-widgets/controls", 283 | "model_name": "ProgressStyleModel", 284 | "model_module_version": "1.5.0", 285 | "state": { 286 | "_model_module": "@jupyter-widgets/controls", 287 | "_model_module_version": "1.5.0", 288 | "_model_name": "ProgressStyleModel", 289 | "_view_count": null, 290 | "_view_module": "@jupyter-widgets/base", 291 | "_view_module_version": "1.2.0", 292 | "_view_name": "StyleView", 293 | "bar_color": null, 294 | "description_width": "" 295 | } 296 | }, 297 | "8452a8bd41ba432e9dc0315c85b18808": { 298 | "model_module": "@jupyter-widgets/base", 299 | "model_name": "LayoutModel", 300 | "model_module_version": "1.2.0", 301 | "state": { 302 | "_model_module": "@jupyter-widgets/base", 303 | "_model_module_version": "1.2.0", 304 | "_model_name": "LayoutModel", 305 | "_view_count": null, 306 | "_view_module": "@jupyter-widgets/base", 307 | "_view_module_version": "1.2.0", 308 | "_view_name": "LayoutView", 309 | "align_content": null, 310 | "align_items": null, 311 | "align_self": null, 312 | "border": null, 313 | "bottom": null, 314 | "display": null, 315 | "flex": null, 316 | "flex_flow": null, 317 | "grid_area": null, 318 | "grid_auto_columns": null, 319 | "grid_auto_flow": null, 320 | "grid_auto_rows": null, 321 | "grid_column": null, 322 | "grid_gap": null, 323 | "grid_row": null, 324 | "grid_template_areas": null, 325 | "grid_template_columns": null, 326 | "grid_template_rows": null, 327 | "height": null, 328 | "justify_content": null, 329 | "justify_items": null, 330 | "left": null, 331 | "margin": null, 332 | "max_height": null, 333 | "max_width": null, 334 | "min_height": null, 335 | "min_width": null, 336 | "object_fit": null, 337 | "object_position": null, 338 | "order": null, 339 | "overflow": null, 340 | "overflow_x": null, 341 | "overflow_y": null, 342 | "padding": null, 343 | "right": null, 344 | "top": null, 345 | "visibility": null, 346 | "width": null 347 | } 348 | }, 349 | "7465b89c8c5b46e28e220ad645b1a46a": { 350 | "model_module": "@jupyter-widgets/controls", 351 | "model_name": "DescriptionStyleModel", 352 | "model_module_version": "1.5.0", 353 | "state": { 354 | "_model_module": "@jupyter-widgets/controls", 355 | "_model_module_version": "1.5.0", 356 | "_model_name": "DescriptionStyleModel", 357 | "_view_count": null, 358 | "_view_module": "@jupyter-widgets/base", 359 | "_view_module_version": "1.2.0", 360 | "_view_name": "StyleView", 361 | "description_width": "" 362 | } 363 | }, 364 | "6aec014e2d404a0398d957ff7d0b2a65": { 365 | "model_module": "@jupyter-widgets/controls", 366 | "model_name": "HBoxModel", 367 | "model_module_version": "1.5.0", 368 | "state": { 369 | "_dom_classes": [], 370 | "_model_module": "@jupyter-widgets/controls", 371 | "_model_module_version": "1.5.0", 372 | "_model_name": "HBoxModel", 373 | "_view_count": null, 374 | "_view_module": "@jupyter-widgets/controls", 375 | "_view_module_version": "1.5.0", 376 | "_view_name": "HBoxView", 377 | "box_style": "", 378 | "children": [ 379 | "IPY_MODEL_f6da45692fc34b68b523c892c483680f", 380 | "IPY_MODEL_a0082c2918ee4eb9ab7a1fba92e45cff", 381 | "IPY_MODEL_9ec03cf11c6c4927ba816bf553dd9e99" 382 | ], 383 | "layout": "IPY_MODEL_24879885a7ff4b5d97e199a5520a7192" 384 | } 385 | }, 386 | "f6da45692fc34b68b523c892c483680f": { 387 | "model_module": "@jupyter-widgets/controls", 388 | "model_name": "HTMLModel", 389 | "model_module_version": "1.5.0", 390 | "state": { 391 | "_dom_classes": [], 392 | "_model_module": "@jupyter-widgets/controls", 393 | "_model_module_version": "1.5.0", 394 | "_model_name": "HTMLModel", 395 | "_view_count": null, 396 | "_view_module": "@jupyter-widgets/controls", 397 | "_view_module_version": "1.5.0", 398 | "_view_name": "HTMLView", 399 | "description": "", 400 | "description_tooltip": null, 401 | "layout": "IPY_MODEL_ad07814f11614b91a69c72ae8fb995ff", 402 | "placeholder": "​", 403 | "style": "IPY_MODEL_c3c45f3c8bf3468eb49b2bb9943e4f77", 404 | "value": "100%" 405 | } 406 | }, 407 | "a0082c2918ee4eb9ab7a1fba92e45cff": { 408 | "model_module": "@jupyter-widgets/controls", 409 | "model_name": "FloatProgressModel", 410 | "model_module_version": "1.5.0", 411 | "state": { 412 | "_dom_classes": [], 413 | "_model_module": "@jupyter-widgets/controls", 414 | "_model_module_version": "1.5.0", 415 | "_model_name": "FloatProgressModel", 416 | "_view_count": null, 417 | "_view_module": "@jupyter-widgets/controls", 418 | "_view_module_version": "1.5.0", 419 | "_view_name": "ProgressView", 420 | "bar_style": "success", 421 | "description": "", 422 | "description_tooltip": null, 423 | "layout": "IPY_MODEL_ead0e1695f424cc7b8125fec85b312a0", 424 | "max": 10, 425 | "min": 0, 426 | "orientation": "horizontal", 427 | "style": "IPY_MODEL_fc90235c138240c0a01c424bab2cf2ce", 428 | "value": 10 429 | } 430 | }, 431 | "9ec03cf11c6c4927ba816bf553dd9e99": { 432 | "model_module": "@jupyter-widgets/controls", 433 | "model_name": "HTMLModel", 434 | "model_module_version": "1.5.0", 435 | "state": { 436 | "_dom_classes": [], 437 | "_model_module": "@jupyter-widgets/controls", 438 | "_model_module_version": "1.5.0", 439 | "_model_name": "HTMLModel", 440 | "_view_count": null, 441 | "_view_module": "@jupyter-widgets/controls", 442 | "_view_module_version": "1.5.0", 443 | "_view_name": "HTMLView", 444 | "description": "", 445 | "description_tooltip": null, 446 | "layout": "IPY_MODEL_1d72bd5c1212463799e96e843abefe0d", 447 | "placeholder": "​", 448 | "style": "IPY_MODEL_1fe9ea51236147009e8eb19f4e054825", 449 | "value": " 10/10 [00:02<00:00, 5.19ba/s]" 450 | } 451 | }, 452 | "24879885a7ff4b5d97e199a5520a7192": { 453 | "model_module": "@jupyter-widgets/base", 454 | "model_name": "LayoutModel", 455 | "model_module_version": "1.2.0", 456 | "state": { 457 | "_model_module": "@jupyter-widgets/base", 458 | "_model_module_version": "1.2.0", 459 | "_model_name": "LayoutModel", 460 | "_view_count": null, 461 | "_view_module": "@jupyter-widgets/base", 462 | "_view_module_version": "1.2.0", 463 | "_view_name": "LayoutView", 464 | "align_content": null, 465 | "align_items": null, 466 | "align_self": null, 467 | "border": null, 468 | "bottom": null, 469 | "display": null, 470 | "flex": null, 471 | "flex_flow": null, 472 | "grid_area": null, 473 | "grid_auto_columns": null, 474 | "grid_auto_flow": null, 475 | "grid_auto_rows": null, 476 | "grid_column": null, 477 | "grid_gap": null, 478 | "grid_row": null, 479 | "grid_template_areas": null, 480 | "grid_template_columns": null, 481 | "grid_template_rows": null, 482 | "height": null, 483 | "justify_content": null, 484 | "justify_items": null, 485 | "left": null, 486 | "margin": null, 487 | "max_height": null, 488 | "max_width": null, 489 | "min_height": null, 490 | "min_width": null, 491 | "object_fit": null, 492 | "object_position": null, 493 | "order": null, 494 | "overflow": null, 495 | "overflow_x": null, 496 | "overflow_y": null, 497 | "padding": null, 498 | "right": null, 499 | "top": null, 500 | "visibility": null, 501 | "width": null 502 | } 503 | }, 504 | "ad07814f11614b91a69c72ae8fb995ff": { 505 | "model_module": "@jupyter-widgets/base", 506 | "model_name": "LayoutModel", 507 | "model_module_version": "1.2.0", 508 | "state": { 509 | "_model_module": "@jupyter-widgets/base", 510 | "_model_module_version": "1.2.0", 511 | "_model_name": "LayoutModel", 512 | "_view_count": null, 513 | "_view_module": "@jupyter-widgets/base", 514 | "_view_module_version": "1.2.0", 515 | "_view_name": "LayoutView", 516 | "align_content": null, 517 | "align_items": null, 518 | "align_self": null, 519 | "border": null, 520 | "bottom": null, 521 | "display": null, 522 | "flex": null, 523 | "flex_flow": null, 524 | "grid_area": null, 525 | "grid_auto_columns": null, 526 | "grid_auto_flow": null, 527 | "grid_auto_rows": null, 528 | "grid_column": null, 529 | "grid_gap": null, 530 | "grid_row": null, 531 | "grid_template_areas": null, 532 | "grid_template_columns": null, 533 | "grid_template_rows": null, 534 | "height": null, 535 | "justify_content": null, 536 | "justify_items": null, 537 | "left": null, 538 | "margin": null, 539 | "max_height": null, 540 | "max_width": null, 541 | "min_height": null, 542 | "min_width": null, 543 | "object_fit": null, 544 | "object_position": null, 545 | "order": null, 546 | "overflow": null, 547 | "overflow_x": null, 548 | "overflow_y": null, 549 | "padding": null, 550 | "right": null, 551 | "top": null, 552 | "visibility": null, 553 | "width": null 554 | } 555 | }, 556 | "c3c45f3c8bf3468eb49b2bb9943e4f77": { 557 | "model_module": "@jupyter-widgets/controls", 558 | "model_name": "DescriptionStyleModel", 559 | "model_module_version": "1.5.0", 560 | "state": { 561 | "_model_module": "@jupyter-widgets/controls", 562 | "_model_module_version": "1.5.0", 563 | "_model_name": "DescriptionStyleModel", 564 | "_view_count": null, 565 | "_view_module": "@jupyter-widgets/base", 566 | "_view_module_version": "1.2.0", 567 | "_view_name": "StyleView", 568 | "description_width": "" 569 | } 570 | }, 571 | "ead0e1695f424cc7b8125fec85b312a0": { 572 | "model_module": "@jupyter-widgets/base", 573 | "model_name": "LayoutModel", 574 | "model_module_version": "1.2.0", 575 | "state": { 576 | "_model_module": "@jupyter-widgets/base", 577 | "_model_module_version": "1.2.0", 578 | "_model_name": "LayoutModel", 579 | "_view_count": null, 580 | "_view_module": "@jupyter-widgets/base", 581 | "_view_module_version": "1.2.0", 582 | "_view_name": "LayoutView", 583 | "align_content": null, 584 | "align_items": null, 585 | "align_self": null, 586 | "border": null, 587 | "bottom": null, 588 | "display": null, 589 | "flex": null, 590 | "flex_flow": null, 591 | "grid_area": null, 592 | "grid_auto_columns": null, 593 | "grid_auto_flow": null, 594 | "grid_auto_rows": null, 595 | "grid_column": null, 596 | "grid_gap": null, 597 | "grid_row": null, 598 | "grid_template_areas": null, 599 | "grid_template_columns": null, 600 | "grid_template_rows": null, 601 | "height": null, 602 | "justify_content": null, 603 | "justify_items": null, 604 | "left": null, 605 | "margin": null, 606 | "max_height": null, 607 | "max_width": null, 608 | "min_height": null, 609 | "min_width": null, 610 | "object_fit": null, 611 | "object_position": null, 612 | "order": null, 613 | "overflow": null, 614 | "overflow_x": null, 615 | "overflow_y": null, 616 | "padding": null, 617 | "right": null, 618 | "top": null, 619 | "visibility": null, 620 | "width": null 621 | } 622 | }, 623 | "fc90235c138240c0a01c424bab2cf2ce": { 624 | "model_module": "@jupyter-widgets/controls", 625 | "model_name": "ProgressStyleModel", 626 | "model_module_version": "1.5.0", 627 | "state": { 628 | "_model_module": "@jupyter-widgets/controls", 629 | "_model_module_version": "1.5.0", 630 | "_model_name": "ProgressStyleModel", 631 | "_view_count": null, 632 | "_view_module": "@jupyter-widgets/base", 633 | "_view_module_version": "1.2.0", 634 | "_view_name": "StyleView", 635 | "bar_color": null, 636 | "description_width": "" 637 | } 638 | }, 639 | "1d72bd5c1212463799e96e843abefe0d": { 640 | "model_module": "@jupyter-widgets/base", 641 | "model_name": "LayoutModel", 642 | "model_module_version": "1.2.0", 643 | "state": { 644 | "_model_module": "@jupyter-widgets/base", 645 | "_model_module_version": "1.2.0", 646 | "_model_name": "LayoutModel", 647 | "_view_count": null, 648 | "_view_module": "@jupyter-widgets/base", 649 | "_view_module_version": "1.2.0", 650 | "_view_name": "LayoutView", 651 | "align_content": null, 652 | "align_items": null, 653 | "align_self": null, 654 | "border": null, 655 | "bottom": null, 656 | "display": null, 657 | "flex": null, 658 | "flex_flow": null, 659 | "grid_area": null, 660 | "grid_auto_columns": null, 661 | "grid_auto_flow": null, 662 | "grid_auto_rows": null, 663 | "grid_column": null, 664 | "grid_gap": null, 665 | "grid_row": null, 666 | "grid_template_areas": null, 667 | "grid_template_columns": null, 668 | "grid_template_rows": null, 669 | "height": null, 670 | "justify_content": null, 671 | "justify_items": null, 672 | "left": null, 673 | "margin": null, 674 | "max_height": null, 675 | "max_width": null, 676 | "min_height": null, 677 | "min_width": null, 678 | "object_fit": null, 679 | "object_position": null, 680 | "order": null, 681 | "overflow": null, 682 | "overflow_x": null, 683 | "overflow_y": null, 684 | "padding": null, 685 | "right": null, 686 | "top": null, 687 | "visibility": null, 688 | "width": null 689 | } 690 | }, 691 | "1fe9ea51236147009e8eb19f4e054825": { 692 | "model_module": "@jupyter-widgets/controls", 693 | "model_name": "DescriptionStyleModel", 694 | "model_module_version": "1.5.0", 695 | "state": { 696 | "_model_module": "@jupyter-widgets/controls", 697 | "_model_module_version": "1.5.0", 698 | "_model_name": "DescriptionStyleModel", 699 | "_view_count": null, 700 | "_view_module": "@jupyter-widgets/base", 701 | "_view_module_version": "1.2.0", 702 | "_view_name": "StyleView", 703 | "description_width": "" 704 | } 705 | }, 706 | "2200195c39054a4a95f553a822c3ca4a": { 707 | "model_module": "@jupyter-widgets/controls", 708 | "model_name": "HBoxModel", 709 | "model_module_version": "1.5.0", 710 | "state": { 711 | "_dom_classes": [], 712 | "_model_module": "@jupyter-widgets/controls", 713 | "_model_module_version": "1.5.0", 714 | "_model_name": "HBoxModel", 715 | "_view_count": null, 716 | "_view_module": "@jupyter-widgets/controls", 717 | "_view_module_version": "1.5.0", 718 | "_view_name": "HBoxView", 719 | "box_style": "", 720 | "children": [ 721 | "IPY_MODEL_0c676fd14879444abd54f70bf1a2326a", 722 | "IPY_MODEL_f255b11d880f4f958d57fce7293aaf6d", 723 | "IPY_MODEL_254562c035fc4d958587f456bcc7b8d2" 724 | ], 725 | "layout": "IPY_MODEL_e59046c976ab46f78596f4c630cc2263" 726 | } 727 | }, 728 | "0c676fd14879444abd54f70bf1a2326a": { 729 | "model_module": "@jupyter-widgets/controls", 730 | "model_name": "HTMLModel", 731 | "model_module_version": "1.5.0", 732 | "state": { 733 | "_dom_classes": [], 734 | "_model_module": "@jupyter-widgets/controls", 735 | "_model_module_version": "1.5.0", 736 | "_model_name": "HTMLModel", 737 | "_view_count": null, 738 | "_view_module": "@jupyter-widgets/controls", 739 | "_view_module_version": "1.5.0", 740 | "_view_name": "HTMLView", 741 | "description": "", 742 | "description_tooltip": null, 743 | "layout": "IPY_MODEL_685e506dd03643fb84459c0e02de6cbe", 744 | "placeholder": "​", 745 | "style": "IPY_MODEL_af7d8ecd0b2e4f9fa154596a909ddf1e", 746 | "value": "100%" 747 | } 748 | }, 749 | "f255b11d880f4f958d57fce7293aaf6d": { 750 | "model_module": "@jupyter-widgets/controls", 751 | "model_name": "FloatProgressModel", 752 | "model_module_version": "1.5.0", 753 | "state": { 754 | "_dom_classes": [], 755 | "_model_module": "@jupyter-widgets/controls", 756 | "_model_module_version": "1.5.0", 757 | "_model_name": "FloatProgressModel", 758 | "_view_count": null, 759 | "_view_module": "@jupyter-widgets/controls", 760 | "_view_module_version": "1.5.0", 761 | "_view_name": "ProgressView", 762 | "bar_style": "success", 763 | "description": "", 764 | "description_tooltip": null, 765 | "layout": "IPY_MODEL_a632d87f60254c238d2d4db3cf1bcd03", 766 | "max": 3, 767 | "min": 0, 768 | "orientation": "horizontal", 769 | "style": "IPY_MODEL_acee3404b44e4aecac9dcbd36e058280", 770 | "value": 3 771 | } 772 | }, 773 | "254562c035fc4d958587f456bcc7b8d2": { 774 | "model_module": "@jupyter-widgets/controls", 775 | "model_name": "HTMLModel", 776 | "model_module_version": "1.5.0", 777 | "state": { 778 | "_dom_classes": [], 779 | "_model_module": "@jupyter-widgets/controls", 780 | "_model_module_version": "1.5.0", 781 | "_model_name": "HTMLModel", 782 | "_view_count": null, 783 | "_view_module": "@jupyter-widgets/controls", 784 | "_view_module_version": "1.5.0", 785 | "_view_name": "HTMLView", 786 | "description": "", 787 | "description_tooltip": null, 788 | "layout": "IPY_MODEL_0c4b7491f39641ab86c49efa9151a71e", 789 | "placeholder": "​", 790 | "style": "IPY_MODEL_7404eb799d1a457d8e43f766d6c5e174", 791 | "value": " 3/3 [00:00<00:00, 2.93it/s]" 792 | } 793 | }, 794 | "e59046c976ab46f78596f4c630cc2263": { 795 | "model_module": "@jupyter-widgets/base", 796 | "model_name": "LayoutModel", 797 | "model_module_version": "1.2.0", 798 | "state": { 799 | "_model_module": "@jupyter-widgets/base", 800 | "_model_module_version": "1.2.0", 801 | "_model_name": "LayoutModel", 802 | "_view_count": null, 803 | "_view_module": "@jupyter-widgets/base", 804 | "_view_module_version": "1.2.0", 805 | "_view_name": "LayoutView", 806 | "align_content": null, 807 | "align_items": null, 808 | "align_self": null, 809 | "border": null, 810 | "bottom": null, 811 | "display": null, 812 | "flex": null, 813 | "flex_flow": null, 814 | "grid_area": null, 815 | "grid_auto_columns": null, 816 | "grid_auto_flow": null, 817 | "grid_auto_rows": null, 818 | "grid_column": null, 819 | "grid_gap": null, 820 | "grid_row": null, 821 | "grid_template_areas": null, 822 | "grid_template_columns": null, 823 | "grid_template_rows": null, 824 | "height": null, 825 | "justify_content": null, 826 | "justify_items": null, 827 | "left": null, 828 | "margin": null, 829 | "max_height": null, 830 | "max_width": null, 831 | "min_height": null, 832 | "min_width": null, 833 | "object_fit": null, 834 | "object_position": null, 835 | "order": null, 836 | "overflow": null, 837 | "overflow_x": null, 838 | "overflow_y": null, 839 | "padding": null, 840 | "right": null, 841 | "top": null, 842 | "visibility": null, 843 | "width": null 844 | } 845 | }, 846 | "685e506dd03643fb84459c0e02de6cbe": { 847 | "model_module": "@jupyter-widgets/base", 848 | "model_name": "LayoutModel", 849 | "model_module_version": "1.2.0", 850 | "state": { 851 | "_model_module": "@jupyter-widgets/base", 852 | "_model_module_version": "1.2.0", 853 | "_model_name": "LayoutModel", 854 | "_view_count": null, 855 | "_view_module": "@jupyter-widgets/base", 856 | "_view_module_version": "1.2.0", 857 | "_view_name": "LayoutView", 858 | "align_content": null, 859 | "align_items": null, 860 | "align_self": null, 861 | "border": null, 862 | "bottom": null, 863 | "display": null, 864 | "flex": null, 865 | "flex_flow": null, 866 | "grid_area": null, 867 | "grid_auto_columns": null, 868 | "grid_auto_flow": null, 869 | "grid_auto_rows": null, 870 | "grid_column": null, 871 | "grid_gap": null, 872 | "grid_row": null, 873 | "grid_template_areas": null, 874 | "grid_template_columns": null, 875 | "grid_template_rows": null, 876 | "height": null, 877 | "justify_content": null, 878 | "justify_items": null, 879 | "left": null, 880 | "margin": null, 881 | "max_height": null, 882 | "max_width": null, 883 | "min_height": null, 884 | "min_width": null, 885 | "object_fit": null, 886 | "object_position": null, 887 | "order": null, 888 | "overflow": null, 889 | "overflow_x": null, 890 | "overflow_y": null, 891 | "padding": null, 892 | "right": null, 893 | "top": null, 894 | "visibility": null, 895 | "width": null 896 | } 897 | }, 898 | "af7d8ecd0b2e4f9fa154596a909ddf1e": { 899 | "model_module": "@jupyter-widgets/controls", 900 | "model_name": "DescriptionStyleModel", 901 | "model_module_version": "1.5.0", 902 | "state": { 903 | "_model_module": "@jupyter-widgets/controls", 904 | "_model_module_version": "1.5.0", 905 | "_model_name": "DescriptionStyleModel", 906 | "_view_count": null, 907 | "_view_module": "@jupyter-widgets/base", 908 | "_view_module_version": "1.2.0", 909 | "_view_name": "StyleView", 910 | "description_width": "" 911 | } 912 | }, 913 | "a632d87f60254c238d2d4db3cf1bcd03": { 914 | "model_module": "@jupyter-widgets/base", 915 | "model_name": "LayoutModel", 916 | "model_module_version": "1.2.0", 917 | "state": { 918 | "_model_module": "@jupyter-widgets/base", 919 | "_model_module_version": "1.2.0", 920 | "_model_name": "LayoutModel", 921 | "_view_count": null, 922 | "_view_module": "@jupyter-widgets/base", 923 | "_view_module_version": "1.2.0", 924 | "_view_name": "LayoutView", 925 | "align_content": null, 926 | "align_items": null, 927 | "align_self": null, 928 | "border": null, 929 | "bottom": null, 930 | "display": null, 931 | "flex": null, 932 | "flex_flow": null, 933 | "grid_area": null, 934 | "grid_auto_columns": null, 935 | "grid_auto_flow": null, 936 | "grid_auto_rows": null, 937 | "grid_column": null, 938 | "grid_gap": null, 939 | "grid_row": null, 940 | "grid_template_areas": null, 941 | "grid_template_columns": null, 942 | "grid_template_rows": null, 943 | "height": null, 944 | "justify_content": null, 945 | "justify_items": null, 946 | "left": null, 947 | "margin": null, 948 | "max_height": null, 949 | "max_width": null, 950 | "min_height": null, 951 | "min_width": null, 952 | "object_fit": null, 953 | "object_position": null, 954 | "order": null, 955 | "overflow": null, 956 | "overflow_x": null, 957 | "overflow_y": null, 958 | "padding": null, 959 | "right": null, 960 | "top": null, 961 | "visibility": null, 962 | "width": null 963 | } 964 | }, 965 | "acee3404b44e4aecac9dcbd36e058280": { 966 | "model_module": "@jupyter-widgets/controls", 967 | "model_name": "ProgressStyleModel", 968 | "model_module_version": "1.5.0", 969 | "state": { 970 | "_model_module": "@jupyter-widgets/controls", 971 | "_model_module_version": "1.5.0", 972 | "_model_name": "ProgressStyleModel", 973 | "_view_count": null, 974 | "_view_module": "@jupyter-widgets/base", 975 | "_view_module_version": "1.2.0", 976 | "_view_name": "StyleView", 977 | "bar_color": null, 978 | "description_width": "" 979 | } 980 | }, 981 | "0c4b7491f39641ab86c49efa9151a71e": { 982 | "model_module": "@jupyter-widgets/base", 983 | "model_name": "LayoutModel", 984 | "model_module_version": "1.2.0", 985 | "state": { 986 | "_model_module": "@jupyter-widgets/base", 987 | "_model_module_version": "1.2.0", 988 | "_model_name": "LayoutModel", 989 | "_view_count": null, 990 | "_view_module": "@jupyter-widgets/base", 991 | "_view_module_version": "1.2.0", 992 | "_view_name": "LayoutView", 993 | "align_content": null, 994 | "align_items": null, 995 | "align_self": null, 996 | "border": null, 997 | "bottom": null, 998 | "display": null, 999 | "flex": null, 1000 | "flex_flow": null, 1001 | "grid_area": null, 1002 | "grid_auto_columns": null, 1003 | "grid_auto_flow": null, 1004 | "grid_auto_rows": null, 1005 | "grid_column": null, 1006 | "grid_gap": null, 1007 | "grid_row": null, 1008 | "grid_template_areas": null, 1009 | "grid_template_columns": null, 1010 | "grid_template_rows": null, 1011 | "height": null, 1012 | "justify_content": null, 1013 | "justify_items": null, 1014 | "left": null, 1015 | "margin": null, 1016 | "max_height": null, 1017 | "max_width": null, 1018 | "min_height": null, 1019 | "min_width": null, 1020 | "object_fit": null, 1021 | "object_position": null, 1022 | "order": null, 1023 | "overflow": null, 1024 | "overflow_x": null, 1025 | "overflow_y": null, 1026 | "padding": null, 1027 | "right": null, 1028 | "top": null, 1029 | "visibility": null, 1030 | "width": null 1031 | } 1032 | }, 1033 | "7404eb799d1a457d8e43f766d6c5e174": { 1034 | "model_module": "@jupyter-widgets/controls", 1035 | "model_name": "DescriptionStyleModel", 1036 | "model_module_version": "1.5.0", 1037 | "state": { 1038 | "_model_module": "@jupyter-widgets/controls", 1039 | "_model_module_version": "1.5.0", 1040 | "_model_name": "DescriptionStyleModel", 1041 | "_view_count": null, 1042 | "_view_module": "@jupyter-widgets/base", 1043 | "_view_module_version": "1.2.0", 1044 | "_view_name": "StyleView", 1045 | "description_width": "" 1046 | } 1047 | }, 1048 | "52a9cf4f584a4f1b8580a2bbd8759e57": { 1049 | "model_module": "@jupyter-widgets/controls", 1050 | "model_name": "HBoxModel", 1051 | "model_module_version": "1.5.0", 1052 | "state": { 1053 | "_dom_classes": [], 1054 | "_model_module": "@jupyter-widgets/controls", 1055 | "_model_module_version": "1.5.0", 1056 | "_model_name": "HBoxModel", 1057 | "_view_count": null, 1058 | "_view_module": "@jupyter-widgets/controls", 1059 | "_view_module_version": "1.5.0", 1060 | "_view_name": "HBoxView", 1061 | "box_style": "", 1062 | "children": [ 1063 | "IPY_MODEL_54ad317700f3474092450fc7d32663d9", 1064 | "IPY_MODEL_5263698f1ce34054be5d2d6a0a5bc76b", 1065 | "IPY_MODEL_91c2e2811bad43ee8f055acca9bda414" 1066 | ], 1067 | "layout": "IPY_MODEL_ff9b6eda171546ea99c338da68b45ee6" 1068 | } 1069 | }, 1070 | "54ad317700f3474092450fc7d32663d9": { 1071 | "model_module": "@jupyter-widgets/controls", 1072 | "model_name": "HTMLModel", 1073 | "model_module_version": "1.5.0", 1074 | "state": { 1075 | "_dom_classes": [], 1076 | "_model_module": "@jupyter-widgets/controls", 1077 | "_model_module_version": "1.5.0", 1078 | "_model_name": "HTMLModel", 1079 | "_view_count": null, 1080 | "_view_module": "@jupyter-widgets/controls", 1081 | "_view_module_version": "1.5.0", 1082 | "_view_name": "HTMLView", 1083 | "description": "", 1084 | "description_tooltip": null, 1085 | "layout": "IPY_MODEL_d53e7f33fc57487a86cc2ebe66d2db57", 1086 | "placeholder": "​", 1087 | "style": "IPY_MODEL_844d2c9d36d24cec946d5150410009e5", 1088 | "value": "100%" 1089 | } 1090 | }, 1091 | "5263698f1ce34054be5d2d6a0a5bc76b": { 1092 | "model_module": "@jupyter-widgets/controls", 1093 | "model_name": "FloatProgressModel", 1094 | "model_module_version": "1.5.0", 1095 | "state": { 1096 | "_dom_classes": [], 1097 | "_model_module": "@jupyter-widgets/controls", 1098 | "_model_module_version": "1.5.0", 1099 | "_model_name": "FloatProgressModel", 1100 | "_view_count": null, 1101 | "_view_module": "@jupyter-widgets/controls", 1102 | "_view_module_version": "1.5.0", 1103 | "_view_name": "ProgressView", 1104 | "bar_style": "success", 1105 | "description": "", 1106 | "description_tooltip": null, 1107 | "layout": "IPY_MODEL_27a2507f5b4545df8ca658ad762dbbc7", 1108 | "max": 393, 1109 | "min": 0, 1110 | "orientation": "horizontal", 1111 | "style": "IPY_MODEL_e5001084807c4831a22cc7b00edeb483", 1112 | "value": 393 1113 | } 1114 | }, 1115 | "91c2e2811bad43ee8f055acca9bda414": { 1116 | "model_module": "@jupyter-widgets/controls", 1117 | "model_name": "HTMLModel", 1118 | "model_module_version": "1.5.0", 1119 | "state": { 1120 | "_dom_classes": [], 1121 | "_model_module": "@jupyter-widgets/controls", 1122 | "_model_module_version": "1.5.0", 1123 | "_model_name": "HTMLModel", 1124 | "_view_count": null, 1125 | "_view_module": "@jupyter-widgets/controls", 1126 | "_view_module_version": "1.5.0", 1127 | "_view_name": "HTMLView", 1128 | "description": "", 1129 | "description_tooltip": null, 1130 | "layout": "IPY_MODEL_d174cc1c593243a6aaff0365bba33baf", 1131 | "placeholder": "​", 1132 | "style": "IPY_MODEL_8f5940e21b6344249acb11d0470d9422", 1133 | "value": " 393/393 [00:08<00:00, 47.96ba/s]" 1134 | } 1135 | }, 1136 | "ff9b6eda171546ea99c338da68b45ee6": { 1137 | "model_module": "@jupyter-widgets/base", 1138 | "model_name": "LayoutModel", 1139 | "model_module_version": "1.2.0", 1140 | "state": { 1141 | "_model_module": "@jupyter-widgets/base", 1142 | "_model_module_version": "1.2.0", 1143 | "_model_name": "LayoutModel", 1144 | "_view_count": null, 1145 | "_view_module": "@jupyter-widgets/base", 1146 | "_view_module_version": "1.2.0", 1147 | "_view_name": "LayoutView", 1148 | "align_content": null, 1149 | "align_items": null, 1150 | "align_self": null, 1151 | "border": null, 1152 | "bottom": null, 1153 | "display": null, 1154 | "flex": null, 1155 | "flex_flow": null, 1156 | "grid_area": null, 1157 | "grid_auto_columns": null, 1158 | "grid_auto_flow": null, 1159 | "grid_auto_rows": null, 1160 | "grid_column": null, 1161 | "grid_gap": null, 1162 | "grid_row": null, 1163 | "grid_template_areas": null, 1164 | "grid_template_columns": null, 1165 | "grid_template_rows": null, 1166 | "height": null, 1167 | "justify_content": null, 1168 | "justify_items": null, 1169 | "left": null, 1170 | "margin": null, 1171 | "max_height": null, 1172 | "max_width": null, 1173 | "min_height": null, 1174 | "min_width": null, 1175 | "object_fit": null, 1176 | "object_position": null, 1177 | "order": null, 1178 | "overflow": null, 1179 | "overflow_x": null, 1180 | "overflow_y": null, 1181 | "padding": null, 1182 | "right": null, 1183 | "top": null, 1184 | "visibility": null, 1185 | "width": null 1186 | } 1187 | }, 1188 | "d53e7f33fc57487a86cc2ebe66d2db57": { 1189 | "model_module": "@jupyter-widgets/base", 1190 | "model_name": "LayoutModel", 1191 | "model_module_version": "1.2.0", 1192 | "state": { 1193 | "_model_module": "@jupyter-widgets/base", 1194 | "_model_module_version": "1.2.0", 1195 | "_model_name": "LayoutModel", 1196 | "_view_count": null, 1197 | "_view_module": "@jupyter-widgets/base", 1198 | "_view_module_version": "1.2.0", 1199 | "_view_name": "LayoutView", 1200 | "align_content": null, 1201 | "align_items": null, 1202 | "align_self": null, 1203 | "border": null, 1204 | "bottom": null, 1205 | "display": null, 1206 | "flex": null, 1207 | "flex_flow": null, 1208 | "grid_area": null, 1209 | "grid_auto_columns": null, 1210 | "grid_auto_flow": null, 1211 | "grid_auto_rows": null, 1212 | "grid_column": null, 1213 | "grid_gap": null, 1214 | "grid_row": null, 1215 | "grid_template_areas": null, 1216 | "grid_template_columns": null, 1217 | "grid_template_rows": null, 1218 | "height": null, 1219 | "justify_content": null, 1220 | "justify_items": null, 1221 | "left": null, 1222 | "margin": null, 1223 | "max_height": null, 1224 | "max_width": null, 1225 | "min_height": null, 1226 | "min_width": null, 1227 | "object_fit": null, 1228 | "object_position": null, 1229 | "order": null, 1230 | "overflow": null, 1231 | "overflow_x": null, 1232 | "overflow_y": null, 1233 | "padding": null, 1234 | "right": null, 1235 | "top": null, 1236 | "visibility": null, 1237 | "width": null 1238 | } 1239 | }, 1240 | "844d2c9d36d24cec946d5150410009e5": { 1241 | "model_module": "@jupyter-widgets/controls", 1242 | "model_name": "DescriptionStyleModel", 1243 | "model_module_version": "1.5.0", 1244 | "state": { 1245 | "_model_module": "@jupyter-widgets/controls", 1246 | "_model_module_version": "1.5.0", 1247 | "_model_name": "DescriptionStyleModel", 1248 | "_view_count": null, 1249 | "_view_module": "@jupyter-widgets/base", 1250 | "_view_module_version": "1.2.0", 1251 | "_view_name": "StyleView", 1252 | "description_width": "" 1253 | } 1254 | }, 1255 | "27a2507f5b4545df8ca658ad762dbbc7": { 1256 | "model_module": "@jupyter-widgets/base", 1257 | "model_name": "LayoutModel", 1258 | "model_module_version": "1.2.0", 1259 | "state": { 1260 | "_model_module": "@jupyter-widgets/base", 1261 | "_model_module_version": "1.2.0", 1262 | "_model_name": "LayoutModel", 1263 | "_view_count": null, 1264 | "_view_module": "@jupyter-widgets/base", 1265 | "_view_module_version": "1.2.0", 1266 | "_view_name": "LayoutView", 1267 | "align_content": null, 1268 | "align_items": null, 1269 | "align_self": null, 1270 | "border": null, 1271 | "bottom": null, 1272 | "display": null, 1273 | "flex": null, 1274 | "flex_flow": null, 1275 | "grid_area": null, 1276 | "grid_auto_columns": null, 1277 | "grid_auto_flow": null, 1278 | "grid_auto_rows": null, 1279 | "grid_column": null, 1280 | "grid_gap": null, 1281 | "grid_row": null, 1282 | "grid_template_areas": null, 1283 | "grid_template_columns": null, 1284 | "grid_template_rows": null, 1285 | "height": null, 1286 | "justify_content": null, 1287 | "justify_items": null, 1288 | "left": null, 1289 | "margin": null, 1290 | "max_height": null, 1291 | "max_width": null, 1292 | "min_height": null, 1293 | "min_width": null, 1294 | "object_fit": null, 1295 | "object_position": null, 1296 | "order": null, 1297 | "overflow": null, 1298 | "overflow_x": null, 1299 | "overflow_y": null, 1300 | "padding": null, 1301 | "right": null, 1302 | "top": null, 1303 | "visibility": null, 1304 | "width": null 1305 | } 1306 | }, 1307 | "e5001084807c4831a22cc7b00edeb483": { 1308 | "model_module": "@jupyter-widgets/controls", 1309 | "model_name": "ProgressStyleModel", 1310 | "model_module_version": "1.5.0", 1311 | "state": { 1312 | "_model_module": "@jupyter-widgets/controls", 1313 | "_model_module_version": "1.5.0", 1314 | "_model_name": "ProgressStyleModel", 1315 | "_view_count": null, 1316 | "_view_module": "@jupyter-widgets/base", 1317 | "_view_module_version": "1.2.0", 1318 | "_view_name": "StyleView", 1319 | "bar_color": null, 1320 | "description_width": "" 1321 | } 1322 | }, 1323 | "d174cc1c593243a6aaff0365bba33baf": { 1324 | "model_module": "@jupyter-widgets/base", 1325 | "model_name": "LayoutModel", 1326 | "model_module_version": "1.2.0", 1327 | "state": { 1328 | "_model_module": "@jupyter-widgets/base", 1329 | "_model_module_version": "1.2.0", 1330 | "_model_name": "LayoutModel", 1331 | "_view_count": null, 1332 | "_view_module": "@jupyter-widgets/base", 1333 | "_view_module_version": "1.2.0", 1334 | "_view_name": "LayoutView", 1335 | "align_content": null, 1336 | "align_items": null, 1337 | "align_self": null, 1338 | "border": null, 1339 | "bottom": null, 1340 | "display": null, 1341 | "flex": null, 1342 | "flex_flow": null, 1343 | "grid_area": null, 1344 | "grid_auto_columns": null, 1345 | "grid_auto_flow": null, 1346 | "grid_auto_rows": null, 1347 | "grid_column": null, 1348 | "grid_gap": null, 1349 | "grid_row": null, 1350 | "grid_template_areas": null, 1351 | "grid_template_columns": null, 1352 | "grid_template_rows": null, 1353 | "height": null, 1354 | "justify_content": null, 1355 | "justify_items": null, 1356 | "left": null, 1357 | "margin": null, 1358 | "max_height": null, 1359 | "max_width": null, 1360 | "min_height": null, 1361 | "min_width": null, 1362 | "object_fit": null, 1363 | "object_position": null, 1364 | "order": null, 1365 | "overflow": null, 1366 | "overflow_x": null, 1367 | "overflow_y": null, 1368 | "padding": null, 1369 | "right": null, 1370 | "top": null, 1371 | "visibility": null, 1372 | "width": null 1373 | } 1374 | }, 1375 | "8f5940e21b6344249acb11d0470d9422": { 1376 | "model_module": "@jupyter-widgets/controls", 1377 | "model_name": "DescriptionStyleModel", 1378 | "model_module_version": "1.5.0", 1379 | "state": { 1380 | "_model_module": "@jupyter-widgets/controls", 1381 | "_model_module_version": "1.5.0", 1382 | "_model_name": "DescriptionStyleModel", 1383 | "_view_count": null, 1384 | "_view_module": "@jupyter-widgets/base", 1385 | "_view_module_version": "1.2.0", 1386 | "_view_name": "StyleView", 1387 | "description_width": "" 1388 | } 1389 | }, 1390 | "7794f5a424ac4072aee88f31e09e1e43": { 1391 | "model_module": "@jupyter-widgets/controls", 1392 | "model_name": "HBoxModel", 1393 | "model_module_version": "1.5.0", 1394 | "state": { 1395 | "_dom_classes": [], 1396 | "_model_module": "@jupyter-widgets/controls", 1397 | "_model_module_version": "1.5.0", 1398 | "_model_name": "HBoxModel", 1399 | "_view_count": null, 1400 | "_view_module": "@jupyter-widgets/controls", 1401 | "_view_module_version": "1.5.0", 1402 | "_view_name": "HBoxView", 1403 | "box_style": "", 1404 | "children": [ 1405 | "IPY_MODEL_d129033ce907443cb225703019488771", 1406 | "IPY_MODEL_fc77432baff54b39901b868545422cba", 1407 | "IPY_MODEL_9a2152ab441d4df99b1cd45660f9fd94" 1408 | ], 1409 | "layout": "IPY_MODEL_213266ab59fa4c2eb1bd825d173df309" 1410 | } 1411 | }, 1412 | "d129033ce907443cb225703019488771": { 1413 | "model_module": "@jupyter-widgets/controls", 1414 | "model_name": "HTMLModel", 1415 | "model_module_version": "1.5.0", 1416 | "state": { 1417 | "_dom_classes": [], 1418 | "_model_module": "@jupyter-widgets/controls", 1419 | "_model_module_version": "1.5.0", 1420 | "_model_name": "HTMLModel", 1421 | "_view_count": null, 1422 | "_view_module": "@jupyter-widgets/controls", 1423 | "_view_module_version": "1.5.0", 1424 | "_view_name": "HTMLView", 1425 | "description": "", 1426 | "description_tooltip": null, 1427 | "layout": "IPY_MODEL_35d662bc09134d9c9e0df17551f4d424", 1428 | "placeholder": "​", 1429 | "style": "IPY_MODEL_de7c9c356d464fb3919cb3963acd6681", 1430 | "value": "100%" 1431 | } 1432 | }, 1433 | "fc77432baff54b39901b868545422cba": { 1434 | "model_module": "@jupyter-widgets/controls", 1435 | "model_name": "FloatProgressModel", 1436 | "model_module_version": "1.5.0", 1437 | "state": { 1438 | "_dom_classes": [], 1439 | "_model_module": "@jupyter-widgets/controls", 1440 | "_model_module_version": "1.5.0", 1441 | "_model_name": "FloatProgressModel", 1442 | "_view_count": null, 1443 | "_view_module": "@jupyter-widgets/controls", 1444 | "_view_module_version": "1.5.0", 1445 | "_view_name": "ProgressView", 1446 | "bar_style": "success", 1447 | "description": "", 1448 | "description_tooltip": null, 1449 | "layout": "IPY_MODEL_fd1387ff2d4041dc89ee1be1cbd6f009", 1450 | "max": 10, 1451 | "min": 0, 1452 | "orientation": "horizontal", 1453 | "style": "IPY_MODEL_0a67ca03a2aa42a3992e230d7d74471b", 1454 | "value": 10 1455 | } 1456 | }, 1457 | "9a2152ab441d4df99b1cd45660f9fd94": { 1458 | "model_module": "@jupyter-widgets/controls", 1459 | "model_name": "HTMLModel", 1460 | "model_module_version": "1.5.0", 1461 | "state": { 1462 | "_dom_classes": [], 1463 | "_model_module": "@jupyter-widgets/controls", 1464 | "_model_module_version": "1.5.0", 1465 | "_model_name": "HTMLModel", 1466 | "_view_count": null, 1467 | "_view_module": "@jupyter-widgets/controls", 1468 | "_view_module_version": "1.5.0", 1469 | "_view_name": "HTMLView", 1470 | "description": "", 1471 | "description_tooltip": null, 1472 | "layout": "IPY_MODEL_0fe377abfcfe4c4ca8478fbe12cc73c1", 1473 | "placeholder": "​", 1474 | "style": "IPY_MODEL_1e34d874c513479292fdfff54cf3c635", 1475 | "value": " 10/10 [00:00<00:00, 38.93ba/s]" 1476 | } 1477 | }, 1478 | "213266ab59fa4c2eb1bd825d173df309": { 1479 | "model_module": "@jupyter-widgets/base", 1480 | "model_name": "LayoutModel", 1481 | "model_module_version": "1.2.0", 1482 | "state": { 1483 | "_model_module": "@jupyter-widgets/base", 1484 | "_model_module_version": "1.2.0", 1485 | "_model_name": "LayoutModel", 1486 | "_view_count": null, 1487 | "_view_module": "@jupyter-widgets/base", 1488 | "_view_module_version": "1.2.0", 1489 | "_view_name": "LayoutView", 1490 | "align_content": null, 1491 | "align_items": null, 1492 | "align_self": null, 1493 | "border": null, 1494 | "bottom": null, 1495 | "display": null, 1496 | "flex": null, 1497 | "flex_flow": null, 1498 | "grid_area": null, 1499 | "grid_auto_columns": null, 1500 | "grid_auto_flow": null, 1501 | "grid_auto_rows": null, 1502 | "grid_column": null, 1503 | "grid_gap": null, 1504 | "grid_row": null, 1505 | "grid_template_areas": null, 1506 | "grid_template_columns": null, 1507 | "grid_template_rows": null, 1508 | "height": null, 1509 | "justify_content": null, 1510 | "justify_items": null, 1511 | "left": null, 1512 | "margin": null, 1513 | "max_height": null, 1514 | "max_width": null, 1515 | "min_height": null, 1516 | "min_width": null, 1517 | "object_fit": null, 1518 | "object_position": null, 1519 | "order": null, 1520 | "overflow": null, 1521 | "overflow_x": null, 1522 | "overflow_y": null, 1523 | "padding": null, 1524 | "right": null, 1525 | "top": null, 1526 | "visibility": null, 1527 | "width": null 1528 | } 1529 | }, 1530 | "35d662bc09134d9c9e0df17551f4d424": { 1531 | "model_module": "@jupyter-widgets/base", 1532 | "model_name": "LayoutModel", 1533 | "model_module_version": "1.2.0", 1534 | "state": { 1535 | "_model_module": "@jupyter-widgets/base", 1536 | "_model_module_version": "1.2.0", 1537 | "_model_name": "LayoutModel", 1538 | "_view_count": null, 1539 | "_view_module": "@jupyter-widgets/base", 1540 | "_view_module_version": "1.2.0", 1541 | "_view_name": "LayoutView", 1542 | "align_content": null, 1543 | "align_items": null, 1544 | "align_self": null, 1545 | "border": null, 1546 | "bottom": null, 1547 | "display": null, 1548 | "flex": null, 1549 | "flex_flow": null, 1550 | "grid_area": null, 1551 | "grid_auto_columns": null, 1552 | "grid_auto_flow": null, 1553 | "grid_auto_rows": null, 1554 | "grid_column": null, 1555 | "grid_gap": null, 1556 | "grid_row": null, 1557 | "grid_template_areas": null, 1558 | "grid_template_columns": null, 1559 | "grid_template_rows": null, 1560 | "height": null, 1561 | "justify_content": null, 1562 | "justify_items": null, 1563 | "left": null, 1564 | "margin": null, 1565 | "max_height": null, 1566 | "max_width": null, 1567 | "min_height": null, 1568 | "min_width": null, 1569 | "object_fit": null, 1570 | "object_position": null, 1571 | "order": null, 1572 | "overflow": null, 1573 | "overflow_x": null, 1574 | "overflow_y": null, 1575 | "padding": null, 1576 | "right": null, 1577 | "top": null, 1578 | "visibility": null, 1579 | "width": null 1580 | } 1581 | }, 1582 | "de7c9c356d464fb3919cb3963acd6681": { 1583 | "model_module": "@jupyter-widgets/controls", 1584 | "model_name": "DescriptionStyleModel", 1585 | "model_module_version": "1.5.0", 1586 | "state": { 1587 | "_model_module": "@jupyter-widgets/controls", 1588 | "_model_module_version": "1.5.0", 1589 | "_model_name": "DescriptionStyleModel", 1590 | "_view_count": null, 1591 | "_view_module": "@jupyter-widgets/base", 1592 | "_view_module_version": "1.2.0", 1593 | "_view_name": "StyleView", 1594 | "description_width": "" 1595 | } 1596 | }, 1597 | "fd1387ff2d4041dc89ee1be1cbd6f009": { 1598 | "model_module": "@jupyter-widgets/base", 1599 | "model_name": "LayoutModel", 1600 | "model_module_version": "1.2.0", 1601 | "state": { 1602 | "_model_module": "@jupyter-widgets/base", 1603 | "_model_module_version": "1.2.0", 1604 | "_model_name": "LayoutModel", 1605 | "_view_count": null, 1606 | "_view_module": "@jupyter-widgets/base", 1607 | "_view_module_version": "1.2.0", 1608 | "_view_name": "LayoutView", 1609 | "align_content": null, 1610 | "align_items": null, 1611 | "align_self": null, 1612 | "border": null, 1613 | "bottom": null, 1614 | "display": null, 1615 | "flex": null, 1616 | "flex_flow": null, 1617 | "grid_area": null, 1618 | "grid_auto_columns": null, 1619 | "grid_auto_flow": null, 1620 | "grid_auto_rows": null, 1621 | "grid_column": null, 1622 | "grid_gap": null, 1623 | "grid_row": null, 1624 | "grid_template_areas": null, 1625 | "grid_template_columns": null, 1626 | "grid_template_rows": null, 1627 | "height": null, 1628 | "justify_content": null, 1629 | "justify_items": null, 1630 | "left": null, 1631 | "margin": null, 1632 | "max_height": null, 1633 | "max_width": null, 1634 | "min_height": null, 1635 | "min_width": null, 1636 | "object_fit": null, 1637 | "object_position": null, 1638 | "order": null, 1639 | "overflow": null, 1640 | "overflow_x": null, 1641 | "overflow_y": null, 1642 | "padding": null, 1643 | "right": null, 1644 | "top": null, 1645 | "visibility": null, 1646 | "width": null 1647 | } 1648 | }, 1649 | "0a67ca03a2aa42a3992e230d7d74471b": { 1650 | "model_module": "@jupyter-widgets/controls", 1651 | "model_name": "ProgressStyleModel", 1652 | "model_module_version": "1.5.0", 1653 | "state": { 1654 | "_model_module": "@jupyter-widgets/controls", 1655 | "_model_module_version": "1.5.0", 1656 | "_model_name": "ProgressStyleModel", 1657 | "_view_count": null, 1658 | "_view_module": "@jupyter-widgets/base", 1659 | "_view_module_version": "1.2.0", 1660 | "_view_name": "StyleView", 1661 | "bar_color": null, 1662 | "description_width": "" 1663 | } 1664 | }, 1665 | "0fe377abfcfe4c4ca8478fbe12cc73c1": { 1666 | "model_module": "@jupyter-widgets/base", 1667 | "model_name": "LayoutModel", 1668 | "model_module_version": "1.2.0", 1669 | "state": { 1670 | "_model_module": "@jupyter-widgets/base", 1671 | "_model_module_version": "1.2.0", 1672 | "_model_name": "LayoutModel", 1673 | "_view_count": null, 1674 | "_view_module": "@jupyter-widgets/base", 1675 | "_view_module_version": "1.2.0", 1676 | "_view_name": "LayoutView", 1677 | "align_content": null, 1678 | "align_items": null, 1679 | "align_self": null, 1680 | "border": null, 1681 | "bottom": null, 1682 | "display": null, 1683 | "flex": null, 1684 | "flex_flow": null, 1685 | "grid_area": null, 1686 | "grid_auto_columns": null, 1687 | "grid_auto_flow": null, 1688 | "grid_auto_rows": null, 1689 | "grid_column": null, 1690 | "grid_gap": null, 1691 | "grid_row": null, 1692 | "grid_template_areas": null, 1693 | "grid_template_columns": null, 1694 | "grid_template_rows": null, 1695 | "height": null, 1696 | "justify_content": null, 1697 | "justify_items": null, 1698 | "left": null, 1699 | "margin": null, 1700 | "max_height": null, 1701 | "max_width": null, 1702 | "min_height": null, 1703 | "min_width": null, 1704 | "object_fit": null, 1705 | "object_position": null, 1706 | "order": null, 1707 | "overflow": null, 1708 | "overflow_x": null, 1709 | "overflow_y": null, 1710 | "padding": null, 1711 | "right": null, 1712 | "top": null, 1713 | "visibility": null, 1714 | "width": null 1715 | } 1716 | }, 1717 | "1e34d874c513479292fdfff54cf3c635": { 1718 | "model_module": "@jupyter-widgets/controls", 1719 | "model_name": "DescriptionStyleModel", 1720 | "model_module_version": "1.5.0", 1721 | "state": { 1722 | "_model_module": "@jupyter-widgets/controls", 1723 | "_model_module_version": "1.5.0", 1724 | "_model_name": "DescriptionStyleModel", 1725 | "_view_count": null, 1726 | "_view_module": "@jupyter-widgets/base", 1727 | "_view_module_version": "1.2.0", 1728 | "_view_name": "StyleView", 1729 | "description_width": "" 1730 | } 1731 | }, 1732 | "f426ad93ecef450b989f545ac2f3f384": { 1733 | "model_module": "@jupyter-widgets/controls", 1734 | "model_name": "HBoxModel", 1735 | "model_module_version": "1.5.0", 1736 | "state": { 1737 | "_dom_classes": [], 1738 | "_model_module": "@jupyter-widgets/controls", 1739 | "_model_module_version": "1.5.0", 1740 | "_model_name": "HBoxModel", 1741 | "_view_count": null, 1742 | "_view_module": "@jupyter-widgets/controls", 1743 | "_view_module_version": "1.5.0", 1744 | "_view_name": "HBoxView", 1745 | "box_style": "", 1746 | "children": [ 1747 | "IPY_MODEL_6706b8c4486e4041932a4fed66b03d73", 1748 | "IPY_MODEL_003de4ed5051453cb621e0a220a96e43", 1749 | "IPY_MODEL_c57c9843e9f3450e8e5049d7af3082bb" 1750 | ], 1751 | "layout": "IPY_MODEL_6e010421305144adba37845f17645440" 1752 | } 1753 | }, 1754 | "6706b8c4486e4041932a4fed66b03d73": { 1755 | "model_module": "@jupyter-widgets/controls", 1756 | "model_name": "HTMLModel", 1757 | "model_module_version": "1.5.0", 1758 | "state": { 1759 | "_dom_classes": [], 1760 | "_model_module": "@jupyter-widgets/controls", 1761 | "_model_module_version": "1.5.0", 1762 | "_model_name": "HTMLModel", 1763 | "_view_count": null, 1764 | "_view_module": "@jupyter-widgets/controls", 1765 | "_view_module_version": "1.5.0", 1766 | "_view_name": "HTMLView", 1767 | "description": "", 1768 | "description_tooltip": null, 1769 | "layout": "IPY_MODEL_00cb0b13b04f4d9084fccbff7be6df03", 1770 | "placeholder": "​", 1771 | "style": "IPY_MODEL_c9194f2ed9b648e49eb83256bbbf5c47", 1772 | "value": "100%" 1773 | } 1774 | }, 1775 | "003de4ed5051453cb621e0a220a96e43": { 1776 | "model_module": "@jupyter-widgets/controls", 1777 | "model_name": "FloatProgressModel", 1778 | "model_module_version": "1.5.0", 1779 | "state": { 1780 | "_dom_classes": [], 1781 | "_model_module": "@jupyter-widgets/controls", 1782 | "_model_module_version": "1.5.0", 1783 | "_model_name": "FloatProgressModel", 1784 | "_view_count": null, 1785 | "_view_module": "@jupyter-widgets/controls", 1786 | "_view_module_version": "1.5.0", 1787 | "_view_name": "ProgressView", 1788 | "bar_style": "success", 1789 | "description": "", 1790 | "description_tooltip": null, 1791 | "layout": "IPY_MODEL_df4578b45bc64931a05b2fa1fd85ef6e", 1792 | "max": 10, 1793 | "min": 0, 1794 | "orientation": "horizontal", 1795 | "style": "IPY_MODEL_bb5dbbb1de40411ab7503d1262b3cde9", 1796 | "value": 10 1797 | } 1798 | }, 1799 | "c57c9843e9f3450e8e5049d7af3082bb": { 1800 | "model_module": "@jupyter-widgets/controls", 1801 | "model_name": "HTMLModel", 1802 | "model_module_version": "1.5.0", 1803 | "state": { 1804 | "_dom_classes": [], 1805 | "_model_module": "@jupyter-widgets/controls", 1806 | "_model_module_version": "1.5.0", 1807 | "_model_name": "HTMLModel", 1808 | "_view_count": null, 1809 | "_view_module": "@jupyter-widgets/controls", 1810 | "_view_module_version": "1.5.0", 1811 | "_view_name": "HTMLView", 1812 | "description": "", 1813 | "description_tooltip": null, 1814 | "layout": "IPY_MODEL_5f5d6b430d284e7c996fa98a115c96bb", 1815 | "placeholder": "​", 1816 | "style": "IPY_MODEL_e67a67b21c6c4985a4933554354bf11e", 1817 | "value": " 10/10 [00:00<00:00, 41.71ba/s]" 1818 | } 1819 | }, 1820 | "6e010421305144adba37845f17645440": { 1821 | "model_module": "@jupyter-widgets/base", 1822 | "model_name": "LayoutModel", 1823 | "model_module_version": "1.2.0", 1824 | "state": { 1825 | "_model_module": "@jupyter-widgets/base", 1826 | "_model_module_version": "1.2.0", 1827 | "_model_name": "LayoutModel", 1828 | "_view_count": null, 1829 | "_view_module": "@jupyter-widgets/base", 1830 | "_view_module_version": "1.2.0", 1831 | "_view_name": "LayoutView", 1832 | "align_content": null, 1833 | "align_items": null, 1834 | "align_self": null, 1835 | "border": null, 1836 | "bottom": null, 1837 | "display": null, 1838 | "flex": null, 1839 | "flex_flow": null, 1840 | "grid_area": null, 1841 | "grid_auto_columns": null, 1842 | "grid_auto_flow": null, 1843 | "grid_auto_rows": null, 1844 | "grid_column": null, 1845 | "grid_gap": null, 1846 | "grid_row": null, 1847 | "grid_template_areas": null, 1848 | "grid_template_columns": null, 1849 | "grid_template_rows": null, 1850 | "height": null, 1851 | "justify_content": null, 1852 | "justify_items": null, 1853 | "left": null, 1854 | "margin": null, 1855 | "max_height": null, 1856 | "max_width": null, 1857 | "min_height": null, 1858 | "min_width": null, 1859 | "object_fit": null, 1860 | "object_position": null, 1861 | "order": null, 1862 | "overflow": null, 1863 | "overflow_x": null, 1864 | "overflow_y": null, 1865 | "padding": null, 1866 | "right": null, 1867 | "top": null, 1868 | "visibility": null, 1869 | "width": null 1870 | } 1871 | }, 1872 | "00cb0b13b04f4d9084fccbff7be6df03": { 1873 | "model_module": "@jupyter-widgets/base", 1874 | "model_name": "LayoutModel", 1875 | "model_module_version": "1.2.0", 1876 | "state": { 1877 | "_model_module": "@jupyter-widgets/base", 1878 | "_model_module_version": "1.2.0", 1879 | "_model_name": "LayoutModel", 1880 | "_view_count": null, 1881 | "_view_module": "@jupyter-widgets/base", 1882 | "_view_module_version": "1.2.0", 1883 | "_view_name": "LayoutView", 1884 | "align_content": null, 1885 | "align_items": null, 1886 | "align_self": null, 1887 | "border": null, 1888 | "bottom": null, 1889 | "display": null, 1890 | "flex": null, 1891 | "flex_flow": null, 1892 | "grid_area": null, 1893 | "grid_auto_columns": null, 1894 | "grid_auto_flow": null, 1895 | "grid_auto_rows": null, 1896 | "grid_column": null, 1897 | "grid_gap": null, 1898 | "grid_row": null, 1899 | "grid_template_areas": null, 1900 | "grid_template_columns": null, 1901 | "grid_template_rows": null, 1902 | "height": null, 1903 | "justify_content": null, 1904 | "justify_items": null, 1905 | "left": null, 1906 | "margin": null, 1907 | "max_height": null, 1908 | "max_width": null, 1909 | "min_height": null, 1910 | "min_width": null, 1911 | "object_fit": null, 1912 | "object_position": null, 1913 | "order": null, 1914 | "overflow": null, 1915 | "overflow_x": null, 1916 | "overflow_y": null, 1917 | "padding": null, 1918 | "right": null, 1919 | "top": null, 1920 | "visibility": null, 1921 | "width": null 1922 | } 1923 | }, 1924 | "c9194f2ed9b648e49eb83256bbbf5c47": { 1925 | "model_module": "@jupyter-widgets/controls", 1926 | "model_name": "DescriptionStyleModel", 1927 | "model_module_version": "1.5.0", 1928 | "state": { 1929 | "_model_module": "@jupyter-widgets/controls", 1930 | "_model_module_version": "1.5.0", 1931 | "_model_name": "DescriptionStyleModel", 1932 | "_view_count": null, 1933 | "_view_module": "@jupyter-widgets/base", 1934 | "_view_module_version": "1.2.0", 1935 | "_view_name": "StyleView", 1936 | "description_width": "" 1937 | } 1938 | }, 1939 | "df4578b45bc64931a05b2fa1fd85ef6e": { 1940 | "model_module": "@jupyter-widgets/base", 1941 | "model_name": "LayoutModel", 1942 | "model_module_version": "1.2.0", 1943 | "state": { 1944 | "_model_module": "@jupyter-widgets/base", 1945 | "_model_module_version": "1.2.0", 1946 | "_model_name": "LayoutModel", 1947 | "_view_count": null, 1948 | "_view_module": "@jupyter-widgets/base", 1949 | "_view_module_version": "1.2.0", 1950 | "_view_name": "LayoutView", 1951 | "align_content": null, 1952 | "align_items": null, 1953 | "align_self": null, 1954 | "border": null, 1955 | "bottom": null, 1956 | "display": null, 1957 | "flex": null, 1958 | "flex_flow": null, 1959 | "grid_area": null, 1960 | "grid_auto_columns": null, 1961 | "grid_auto_flow": null, 1962 | "grid_auto_rows": null, 1963 | "grid_column": null, 1964 | "grid_gap": null, 1965 | "grid_row": null, 1966 | "grid_template_areas": null, 1967 | "grid_template_columns": null, 1968 | "grid_template_rows": null, 1969 | "height": null, 1970 | "justify_content": null, 1971 | "justify_items": null, 1972 | "left": null, 1973 | "margin": null, 1974 | "max_height": null, 1975 | "max_width": null, 1976 | "min_height": null, 1977 | "min_width": null, 1978 | "object_fit": null, 1979 | "object_position": null, 1980 | "order": null, 1981 | "overflow": null, 1982 | "overflow_x": null, 1983 | "overflow_y": null, 1984 | "padding": null, 1985 | "right": null, 1986 | "top": null, 1987 | "visibility": null, 1988 | "width": null 1989 | } 1990 | }, 1991 | "bb5dbbb1de40411ab7503d1262b3cde9": { 1992 | "model_module": "@jupyter-widgets/controls", 1993 | "model_name": "ProgressStyleModel", 1994 | "model_module_version": "1.5.0", 1995 | "state": { 1996 | "_model_module": "@jupyter-widgets/controls", 1997 | "_model_module_version": "1.5.0", 1998 | "_model_name": "ProgressStyleModel", 1999 | "_view_count": null, 2000 | "_view_module": "@jupyter-widgets/base", 2001 | "_view_module_version": "1.2.0", 2002 | "_view_name": "StyleView", 2003 | "bar_color": null, 2004 | "description_width": "" 2005 | } 2006 | }, 2007 | "5f5d6b430d284e7c996fa98a115c96bb": { 2008 | "model_module": "@jupyter-widgets/base", 2009 | "model_name": "LayoutModel", 2010 | "model_module_version": "1.2.0", 2011 | "state": { 2012 | "_model_module": "@jupyter-widgets/base", 2013 | "_model_module_version": "1.2.0", 2014 | "_model_name": "LayoutModel", 2015 | "_view_count": null, 2016 | "_view_module": "@jupyter-widgets/base", 2017 | "_view_module_version": "1.2.0", 2018 | "_view_name": "LayoutView", 2019 | "align_content": null, 2020 | "align_items": null, 2021 | "align_self": null, 2022 | "border": null, 2023 | "bottom": null, 2024 | "display": null, 2025 | "flex": null, 2026 | "flex_flow": null, 2027 | "grid_area": null, 2028 | "grid_auto_columns": null, 2029 | "grid_auto_flow": null, 2030 | "grid_auto_rows": null, 2031 | "grid_column": null, 2032 | "grid_gap": null, 2033 | "grid_row": null, 2034 | "grid_template_areas": null, 2035 | "grid_template_columns": null, 2036 | "grid_template_rows": null, 2037 | "height": null, 2038 | "justify_content": null, 2039 | "justify_items": null, 2040 | "left": null, 2041 | "margin": null, 2042 | "max_height": null, 2043 | "max_width": null, 2044 | "min_height": null, 2045 | "min_width": null, 2046 | "object_fit": null, 2047 | "object_position": null, 2048 | "order": null, 2049 | "overflow": null, 2050 | "overflow_x": null, 2051 | "overflow_y": null, 2052 | "padding": null, 2053 | "right": null, 2054 | "top": null, 2055 | "visibility": null, 2056 | "width": null 2057 | } 2058 | }, 2059 | "e67a67b21c6c4985a4933554354bf11e": { 2060 | "model_module": "@jupyter-widgets/controls", 2061 | "model_name": "DescriptionStyleModel", 2062 | "model_module_version": "1.5.0", 2063 | "state": { 2064 | "_model_module": "@jupyter-widgets/controls", 2065 | "_model_module_version": "1.5.0", 2066 | "_model_name": "DescriptionStyleModel", 2067 | "_view_count": null, 2068 | "_view_module": "@jupyter-widgets/base", 2069 | "_view_module_version": "1.2.0", 2070 | "_view_name": "StyleView", 2071 | "description_width": "" 2072 | } 2073 | } 2074 | } 2075 | } 2076 | }, 2077 | "cells": [ 2078 | { 2079 | "cell_type": "markdown", 2080 | "metadata": { 2081 | "id": "view-in-github", 2082 | "colab_type": "text" 2083 | }, 2084 | "source": [ 2085 | "\"Open" 2086 | ] 2087 | }, 2088 | { 2089 | "cell_type": "markdown", 2090 | "source": [ 2091 | "# Pytorch Tutorial" 2092 | ], 2093 | "metadata": { 2094 | "id": "G6NJgNUP8LLV" 2095 | } 2096 | }, 2097 | { 2098 | "cell_type": "markdown", 2099 | "source": [ 2100 | "このチュートリアルは以下の2つの内容を含みます.\n", 2101 | "\n", 2102 | "\n", 2103 | "1. BERTを使った含意分類モデルのfine tuning\n", 2104 | "2. BERT2BERTを用いた含意文生成モデルのfine tuning\n", 2105 | "\n" 2106 | ], 2107 | "metadata": { 2108 | "id": "UNgomUxE8Oal" 2109 | } 2110 | }, 2111 | { 2112 | "cell_type": "markdown", 2113 | "source": [ 2114 | "## Install liblaries" 2115 | ], 2116 | "metadata": { 2117 | "id": "nQEy-cNYUPyU" 2118 | } 2119 | }, 2120 | { 2121 | "cell_type": "code", 2122 | "source": [ 2123 | "!pip install transformers\n", 2124 | "!pip install datasets\n", 2125 | "!pip install rouge_score" 2126 | ], 2127 | "metadata": { 2128 | "colab": { 2129 | "base_uri": "https://localhost:8080/" 2130 | }, 2131 | "id": "pjFXjHO7TDOT", 2132 | "outputId": "3fd9ee50-0cd6-436a-e6be-f1f0be548ba9" 2133 | }, 2134 | "execution_count": null, 2135 | "outputs": [ 2136 | { 2137 | "output_type": "stream", 2138 | "name": "stdout", 2139 | "text": [ 2140 | "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", 2141 | "Requirement already satisfied: transformers in /usr/local/lib/python3.7/dist-packages (4.19.2)\n", 2142 | "Requirement already satisfied: tokenizers!=0.11.3,<0.13,>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from transformers) (0.12.1)\n", 2143 | "Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from transformers) (3.7.0)\n", 2144 | "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from transformers) (21.3)\n", 2145 | "Requirement already satisfied: huggingface-hub<1.0,>=0.1.0 in /usr/local/lib/python3.7/dist-packages (from transformers) (0.7.0)\n", 2146 | "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.7/dist-packages (from transformers) (6.0)\n", 2147 | "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from transformers) (1.21.6)\n", 2148 | "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.7/dist-packages (from transformers) (4.64.0)\n", 2149 | "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers) (2019.12.20)\n", 2150 | "Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from transformers) (2.23.0)\n", 2151 | "Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from transformers) (4.11.3)\n", 2152 | "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers) (4.2.0)\n", 2153 | "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=20.0->transformers) (3.0.9)\n", 2154 | "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->transformers) (3.8.0)\n", 2155 | "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (2.10)\n", 2156 | "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (1.25.11)\n", 2157 | "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (3.0.4)\n", 2158 | "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (2022.5.18.1)\n", 2159 | "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", 2160 | "Requirement already satisfied: datasets in /usr/local/lib/python3.7/dist-packages (2.2.2)\n", 2161 | "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from datasets) (1.21.6)\n", 2162 | "Requirement already satisfied: responses<0.19 in /usr/local/lib/python3.7/dist-packages (from datasets) (0.18.0)\n", 2163 | "Requirement already satisfied: tqdm>=4.62.1 in /usr/local/lib/python3.7/dist-packages (from datasets) (4.64.0)\n", 2164 | "Requirement already satisfied: huggingface-hub<1.0.0,>=0.1.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (0.7.0)\n", 2165 | "Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from datasets) (1.3.5)\n", 2166 | "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (2.23.0)\n", 2167 | "Requirement already satisfied: pyarrow>=6.0.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (6.0.1)\n", 2168 | "Requirement already satisfied: aiohttp in /usr/local/lib/python3.7/dist-packages (from datasets) (3.8.1)\n", 2169 | "Requirement already satisfied: dill<0.3.5 in /usr/local/lib/python3.7/dist-packages (from datasets) (0.3.4)\n", 2170 | "Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from datasets) (4.11.3)\n", 2171 | "Requirement already satisfied: fsspec[http]>=2021.05.0 in /usr/local/lib/python3.7/dist-packages (from datasets) (2022.5.0)\n", 2172 | "Requirement already satisfied: xxhash in /usr/local/lib/python3.7/dist-packages (from datasets) (3.0.0)\n", 2173 | "Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from datasets) (21.3)\n", 2174 | "Requirement already satisfied: multiprocess in /usr/local/lib/python3.7/dist-packages (from datasets) (0.70.12.2)\n", 2175 | "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets) (4.2.0)\n", 2176 | "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets) (6.0)\n", 2177 | "Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0.0,>=0.1.0->datasets) (3.7.0)\n", 2178 | "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging->datasets) (3.0.9)\n", 2179 | "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (3.0.4)\n", 2180 | "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (2022.5.18.1)\n", 2181 | "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (1.25.11)\n", 2182 | "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19.0->datasets) (2.10)\n", 2183 | "Requirement already satisfied: asynctest==0.13.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (0.13.0)\n", 2184 | "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (6.0.2)\n", 2185 | "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (21.4.0)\n", 2186 | "Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (2.0.12)\n", 2187 | "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (1.7.2)\n", 2188 | "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (1.3.0)\n", 2189 | "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (4.0.2)\n", 2190 | "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.7/dist-packages (from aiohttp->datasets) (1.2.0)\n", 2191 | "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->datasets) (3.8.0)\n", 2192 | "Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->datasets) (2022.1)\n", 2193 | "Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas->datasets) (2.8.2)\n", 2194 | "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas->datasets) (1.15.0)\n", 2195 | "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", 2196 | "Requirement already satisfied: rouge_score in /usr/local/lib/python3.7/dist-packages (0.0.4)\n", 2197 | "Requirement already satisfied: absl-py in /usr/local/lib/python3.7/dist-packages (from rouge_score) (1.0.0)\n", 2198 | "Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from rouge_score) (1.21.6)\n", 2199 | "Requirement already satisfied: six>=1.14.0 in /usr/local/lib/python3.7/dist-packages (from rouge_score) (1.15.0)\n", 2200 | "Requirement already satisfied: nltk in /usr/local/lib/python3.7/dist-packages (from rouge_score) (3.2.5)\n" 2201 | ] 2202 | } 2203 | ] 2204 | }, 2205 | { 2206 | "cell_type": "markdown", 2207 | "source": [ 2208 | "# Imports" 2209 | ], 2210 | "metadata": { 2211 | "id": "9BpHFv3u9eht" 2212 | } 2213 | }, 2214 | { 2215 | "cell_type": "code", 2216 | "source": [ 2217 | "from transformers import (\n", 2218 | " AutoTokenizer,\n", 2219 | " AutoModelForSequenceClassification,\n", 2220 | " Trainer, \n", 2221 | " TrainingArguments,\n", 2222 | " EncoderDecoderModel,\n", 2223 | " Seq2SeqTrainer, \n", 2224 | " Seq2SeqTrainingArguments\n", 2225 | ") \n", 2226 | "import transformers\n", 2227 | "import torch\n", 2228 | "from tqdm import tqdm\n", 2229 | "from datasets import load_dataset\n", 2230 | "import random\n", 2231 | "from sklearn.metrics import precision_recall_fscore_support, accuracy_score\n", 2232 | "import pandas as pd\n", 2233 | "# Avoid load model warnings\n", 2234 | "import logging\n", 2235 | "transformers.tokenization_utils.logger.setLevel(logging.ERROR)\n", 2236 | "transformers.configuration_utils.logger.setLevel(logging.ERROR)\n", 2237 | "transformers.modeling_utils.logger.setLevel(logging.ERROR)" 2238 | ], 2239 | "metadata": { 2240 | "id": "GE-jQliy9gBM" 2241 | }, 2242 | "execution_count": null, 2243 | "outputs": [] 2244 | }, 2245 | { 2246 | "cell_type": "markdown", 2247 | "source": [ 2248 | "# GPU Setup\n", 2249 | "\n", 2250 | "+ GPUの使用ができるかどうかをtorch.cuda.is_abailable()で確認.\n", 2251 | "+ CUDA_VISIBLE_DEVICESはコマンドラインで忘れるならos.environで指定してもよい.\n", 2252 | "+ datasetsのcacheはHF_DATASETS_CACHEで指定可能.指定しておくのがオススメ\n" 2253 | ], 2254 | "metadata": { 2255 | "id": "WxAyRUVD9h4F" 2256 | } 2257 | }, 2258 | { 2259 | "cell_type": "code", 2260 | "source": [ 2261 | "\"\"\" optional settings\n", 2262 | "import os\n", 2263 | "os.environ[\"TOKENIZERS_PARALLELISM\"] = \"true\"\n", 2264 | "os.environ['TRANSFORMERS_CACHE'] = \"./\"\n", 2265 | "os.environ['HF_DATASETS_CACHE'] = \"./\"\n", 2266 | "os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'\n", 2267 | "os.environ['CUDA_VISIBLE_DEVICES'] = \"0,1,2,3\"\n", 2268 | "\"\"\"\n", 2269 | "CUDA_AVAILABLE = False\n", 2270 | "if torch.cuda.is_available():\n", 2271 | " CUDA_AVAILABLE = True\n", 2272 | " print(\"CUDA IS AVAILABLE\")\n", 2273 | "else:\n", 2274 | " print(\"CUDA NOT AVAILABLE\")\n", 2275 | "#device = torch.device('cpu')\n", 2276 | "device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')" 2277 | ], 2278 | "metadata": { 2279 | "id": "FMH3SkKq9jXd", 2280 | "colab": { 2281 | "base_uri": "https://localhost:8080/" 2282 | }, 2283 | "outputId": "f9344e3e-8bc6-460b-f726-48b8fbaa1f29" 2284 | }, 2285 | "execution_count": null, 2286 | "outputs": [ 2287 | { 2288 | "output_type": "stream", 2289 | "name": "stdout", 2290 | "text": [ 2291 | "CUDA IS AVAILABLE\n" 2292 | ] 2293 | } 2294 | ] 2295 | }, 2296 | { 2297 | "cell_type": "markdown", 2298 | "source": [ 2299 | "# 分類モデル\n", 2300 | "\n", 2301 | "自然言語推論(Natural Language Inferece)をする分類器を構築する." 2302 | ], 2303 | "metadata": { 2304 | "id": "sjf6TMXm9azd" 2305 | } 2306 | }, 2307 | { 2308 | "cell_type": "code", 2309 | "source": [ 2310 | "def tokenize(batch):\n", 2311 | " return tokenizer(batch[\"premise\"], batch[\"hypothesis\"], padding=\"max_length\", truncation=True, max_length=256)\n", 2312 | "\n", 2313 | "def compute_metrics(pred):\n", 2314 | " labels = pred.label_ids\n", 2315 | " preds = pred.predictions.argmax(-1)\n", 2316 | " precision, recall, f1, _ = precision_recall_fscore_support(labels, preds, average='micro')\n", 2317 | " acc = accuracy_score(labels, preds)\n", 2318 | " return {\n", 2319 | " 'accuracy': acc,\n", 2320 | " 'f1': f1,\n", 2321 | " 'precision': precision,\n", 2322 | " 'recall': recall\n", 2323 | " }" 2324 | ], 2325 | "metadata": { 2326 | "id": "SpE7BF1EUdZT" 2327 | }, 2328 | "execution_count": null, 2329 | "outputs": [] 2330 | }, 2331 | { 2332 | "cell_type": "markdown", 2333 | "source": [ 2334 | "## Loading model and tokenizer" 2335 | ], 2336 | "metadata": { 2337 | "id": "gdi22AmSMF-z" 2338 | } 2339 | }, 2340 | { 2341 | "cell_type": "code", 2342 | "source": [ 2343 | "BATCH_SIZE = 8\n", 2344 | "MAX_LENGTH = 128\n", 2345 | "NUM_EPOCHS = 2\n", 2346 | "\n", 2347 | "model = AutoModelForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=3)\n", 2348 | "tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')" 2349 | ], 2350 | "metadata": { 2351 | "id": "bASNlm_2UhY6" 2352 | }, 2353 | "execution_count": null, 2354 | "outputs": [] 2355 | }, 2356 | { 2357 | "cell_type": "markdown", 2358 | "source": [ 2359 | "## Load MNLI datasets and preprocessing" 2360 | ], 2361 | "metadata": { 2362 | "id": "oixZx0P2MKJq" 2363 | } 2364 | }, 2365 | { 2366 | "cell_type": "code", 2367 | "source": [ 2368 | "raw_datasets = load_dataset(\"multi_nli\")\n", 2369 | "tokenized_datasets = raw_datasets.map(tokenize, batched=True)\n", 2370 | "tokenized_datasets = tokenized_datasets.remove_columns(\n", 2371 | " ['promptID','pairID', 'premise','premise_binary_parse','premise_parse', 'hypothesis','hypothesis_binary_parse', 'hypothesis_parse','genre']\n", 2372 | ")\n", 2373 | "# データ数が多いと時間かかるので少なくする\n", 2374 | "train_dataset = tokenized_datasets[\"train\"].select(range(400))\n", 2375 | "test_dataset = tokenized_datasets[\"validation_matched\"].select(range(50))\n", 2376 | "train_dataset, test_dataset" 2377 | ], 2378 | "metadata": { 2379 | "id": "y-RguGO_9HEd", 2380 | "colab": { 2381 | "base_uri": "https://localhost:8080/", 2382 | "height": 272, 2383 | "referenced_widgets": [ 2384 | "7fac7f3bf8014d36af131ba7fe6bc04d", 2385 | "a43e7698afbb4f33b94f7bc572761a35", 2386 | "d4a18ada25404ae0b0110d0e2ad9621e", 2387 | "68c82d6d0309489b9bb143ae22246949", 2388 | "37f00a01ae9843c3b4203d7adcf9f366", 2389 | "95c26eaaabe84b298689ec2162e20c88", 2390 | "8f38acb6bf0646ae9d66948d6ad877ee", 2391 | "51346874e02042ffb7747ff2c7aba8e4", 2392 | "b888fab607004a9d9915fa8ab08f1897", 2393 | "8452a8bd41ba432e9dc0315c85b18808", 2394 | "7465b89c8c5b46e28e220ad645b1a46a", 2395 | "6aec014e2d404a0398d957ff7d0b2a65", 2396 | "f6da45692fc34b68b523c892c483680f", 2397 | "a0082c2918ee4eb9ab7a1fba92e45cff", 2398 | "9ec03cf11c6c4927ba816bf553dd9e99", 2399 | "24879885a7ff4b5d97e199a5520a7192", 2400 | "ad07814f11614b91a69c72ae8fb995ff", 2401 | "c3c45f3c8bf3468eb49b2bb9943e4f77", 2402 | "ead0e1695f424cc7b8125fec85b312a0", 2403 | "fc90235c138240c0a01c424bab2cf2ce", 2404 | "1d72bd5c1212463799e96e843abefe0d", 2405 | "1fe9ea51236147009e8eb19f4e054825" 2406 | ] 2407 | }, 2408 | "outputId": "28d6c241-49d3-4068-92a9-59bfd0f62323" 2409 | }, 2410 | "execution_count": null, 2411 | "outputs": [ 2412 | { 2413 | "output_type": "stream", 2414 | "name": "stderr", 2415 | "text": [ 2416 | "Using custom data configuration default\n", 2417 | "Reusing dataset multi_nli (/root/.cache/huggingface/datasets/multi_nli/default/0.0.0/591f72eb6263d1ab527561777936b199b714cda156d35716881158a2bd144f39)\n" 2418 | ] 2419 | }, 2420 | { 2421 | "output_type": "display_data", 2422 | "data": { 2423 | "text/plain": [ 2424 | " 0%| | 0/3 [00:00" 2545 | ], 2546 | "text/html": [ 2547 | "\n", 2548 | "
\n", 2549 | " \n", 2550 | " \n", 2551 | " [100/100 00:38, Epoch 2/2]\n", 2552 | "
\n", 2553 | " \n", 2554 | " \n", 2555 | " \n", 2556 | " \n", 2557 | " \n", 2558 | " \n", 2559 | " \n", 2560 | " \n", 2561 | " \n", 2562 | "
StepTraining Loss

" 2563 | ] 2564 | }, 2565 | "metadata": {} 2566 | }, 2567 | { 2568 | "output_type": "stream", 2569 | "name": "stderr", 2570 | "text": [ 2571 | "Saving model checkpoint to ./checkpoint-100\n", 2572 | "\n", 2573 | "\n", 2574 | "Training completed. Do not forget to share your model on huggingface.co/models =)\n", 2575 | "\n", 2576 | "\n", 2577 | "***** Running Evaluation *****\n", 2578 | " Num examples = 50\n", 2579 | " Batch size = 8\n" 2580 | ] 2581 | }, 2582 | { 2583 | "output_type": "display_data", 2584 | "data": { 2585 | "text/plain": [ 2586 | "" 2587 | ], 2588 | "text/html": [ 2589 | "\n", 2590 | "

\n", 2591 | " \n", 2592 | " \n", 2593 | " [7/7 00:00]\n", 2594 | "
\n", 2595 | " " 2596 | ] 2597 | }, 2598 | "metadata": {} 2599 | }, 2600 | { 2601 | "output_type": "execute_result", 2602 | "data": { 2603 | "text/plain": [ 2604 | "{'epoch': 2.0,\n", 2605 | " 'eval_accuracy': 0.34,\n", 2606 | " 'eval_f1': 0.34,\n", 2607 | " 'eval_loss': 1.1039652824401855,\n", 2608 | " 'eval_precision': 0.34,\n", 2609 | " 'eval_recall': 0.34,\n", 2610 | " 'eval_runtime': 0.8177,\n", 2611 | " 'eval_samples_per_second': 61.144,\n", 2612 | " 'eval_steps_per_second': 8.56}" 2613 | ] 2614 | }, 2615 | "metadata": {}, 2616 | "execution_count": 24 2617 | } 2618 | ] 2619 | }, 2620 | { 2621 | "cell_type": "markdown", 2622 | "source": [ 2623 | "## predict by fine tuned model" 2624 | ], 2625 | "metadata": { 2626 | "id": "Z0n_haQsj5x4" 2627 | } 2628 | }, 2629 | { 2630 | "cell_type": "code", 2631 | "source": [ 2632 | "pred = classification_model(torch.tensor(test_dataset[\"input_ids\"][0:10]))\n", 2633 | "pred" 2634 | ], 2635 | "metadata": { 2636 | "colab": { 2637 | "base_uri": "https://localhost:8080/" 2638 | }, 2639 | "id": "64vesgQ5j87g", 2640 | "outputId": "431af27c-073d-4da1-dc07-cf7071330e2c" 2641 | }, 2642 | "execution_count": null, 2643 | "outputs": [ 2644 | { 2645 | "output_type": "execute_result", 2646 | "data": { 2647 | "text/plain": [ 2648 | "SequenceClassifierOutput([('logits', tensor([[-0.0239, 0.0068, -0.3391],\n", 2649 | " [ 0.0102, -0.0229, -0.2956],\n", 2650 | " [ 0.0431, 0.0213, -0.2269],\n", 2651 | " [ 0.0300, -0.0063, -0.2523],\n", 2652 | " [ 0.0370, -0.0021, -0.2569],\n", 2653 | " [ 0.0132, -0.0017, -0.2976],\n", 2654 | " [ 0.0859, 0.0508, -0.1927],\n", 2655 | " [-0.0331, -0.0096, -0.3775],\n", 2656 | " [ 0.0159, 0.0032, -0.3178],\n", 2657 | " [ 0.0517, 0.0275, -0.2442]], grad_fn=))])" 2658 | ] 2659 | }, 2660 | "metadata": {}, 2661 | "execution_count": 25 2662 | } 2663 | ] 2664 | }, 2665 | { 2666 | "cell_type": "markdown", 2667 | "source": [ 2668 | "## Load fine tuned model" 2669 | ], 2670 | "metadata": { 2671 | "id": "mV6mP3PbhQOe" 2672 | } 2673 | }, 2674 | { 2675 | "cell_type": "code", 2676 | "source": [ 2677 | "classification_model = model.from_pretrained(\"./checkpoint-100\")\n", 2678 | "classification_model.config.max_length = 256" 2679 | ], 2680 | "metadata": { 2681 | "id": "ZFn6m4NAhP13" 2682 | }, 2683 | "execution_count": null, 2684 | "outputs": [] 2685 | }, 2686 | { 2687 | "cell_type": "markdown", 2688 | "source": [ 2689 | "## logits to labels\n", 2690 | "\n", 2691 | "+ entailment (0)\n", 2692 | "+ neutral (1)\n", 2693 | "+ contradiction (2)" 2694 | ], 2695 | "metadata": { 2696 | "id": "BN0Ib25hj0mm" 2697 | } 2698 | }, 2699 | { 2700 | "cell_type": "code", 2701 | "source": [ 2702 | "pred = pred[0].detach().numpy().tolist()\n", 2703 | "pred = [*map(lambda x: x.index(max(x)), pred)]\n", 2704 | "pred, test_dataset[\"label\"][0:10]" 2705 | ], 2706 | "metadata": { 2707 | "colab": { 2708 | "base_uri": "https://localhost:8080/" 2709 | }, 2710 | "id": "q4Ck_M1kjF5H", 2711 | "outputId": "d2788a03-36e7-4000-88be-b5b9c7c758ad" 2712 | }, 2713 | "execution_count": null, 2714 | "outputs": [ 2715 | { 2716 | "output_type": "execute_result", 2717 | "data": { 2718 | "text/plain": [ 2719 | "([1, 0, 0, 0, 0, 0, 0, 1, 0, 0], [1, 2, 0, 2, 2, 2, 2, 1, 2, 1])" 2720 | ] 2721 | }, 2722 | "metadata": {}, 2723 | "execution_count": 27 2724 | } 2725 | ] 2726 | }, 2727 | { 2728 | "cell_type": "markdown", 2729 | "source": [ 2730 | "# 生成モデル\n", 2731 | "\n", 2732 | "入力文に含意な文を生成するモデルを作成する" 2733 | ], 2734 | "metadata": { 2735 | "id": "Dzy2lRHlTU_z" 2736 | } 2737 | }, 2738 | { 2739 | "cell_type": "code", 2740 | "source": [ 2741 | "def compute_metrics(pred):\n", 2742 | " labels = pred.label_ids\n", 2743 | " preds = pred.predictions.argmax(-1)\n", 2744 | " precision, recall, f1, _ = precision_recall_fscore_support(labels, preds, average='weighted')\n", 2745 | " acc = accuracy_score(labels, preds)\n", 2746 | " return {\n", 2747 | " 'accuracy': acc,\n", 2748 | " 'f1': f1,\n", 2749 | " 'precision': precision,\n", 2750 | " 'recall': recall\n", 2751 | " }" 2752 | ], 2753 | "metadata": { 2754 | "id": "rPYWLSKBWbgz" 2755 | }, 2756 | "execution_count": null, 2757 | "outputs": [] 2758 | }, 2759 | { 2760 | "cell_type": "markdown", 2761 | "source": [ 2762 | "## load tokenizer and Encoder Decoder Model" 2763 | ], 2764 | "metadata": { 2765 | "id": "xvGWidNEMhia" 2766 | } 2767 | }, 2768 | { 2769 | "cell_type": "code", 2770 | "source": [ 2771 | "tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')\n", 2772 | "generation_model = EncoderDecoderModel.from_encoder_decoder_pretrained('bert-base-uncased', 'bert-base-uncased') # initialize Bert2Bert from pre-trained checkpoints" 2773 | ], 2774 | "metadata": { 2775 | "id": "xyi9WWJfWf1r", 2776 | "colab": { 2777 | "base_uri": "https://localhost:8080/" 2778 | }, 2779 | "outputId": "293b5398-0abf-4c35-8a4f-1761d306c116" 2780 | }, 2781 | "execution_count": null, 2782 | "outputs": [ 2783 | { 2784 | "output_type": "stream", 2785 | "name": "stderr", 2786 | "text": [ 2787 | "loading file https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt from cache at /root/.cache/huggingface/transformers/45c3f7a79a80e1cf0a489e5c62b43f173c15db47864303a55d623bb3c96f72a5.d789d64ebfe299b0e416afc4a169632f903f693095b4629a7ea271d5a0cf2c99\n", 2788 | "loading file https://huggingface.co/bert-base-uncased/resolve/main/tokenizer.json from cache at /root/.cache/huggingface/transformers/534479488c54aeaf9c3406f647aa2ec13648c06771ffe269edabebd4c412da1d.7f2721073f19841be16f41b0a70b600ca6b880c8f3df6f3535cbc704371bdfa4\n", 2789 | "loading file https://huggingface.co/bert-base-uncased/resolve/main/added_tokens.json from cache at None\n", 2790 | "loading file https://huggingface.co/bert-base-uncased/resolve/main/special_tokens_map.json from cache at None\n", 2791 | "loading file https://huggingface.co/bert-base-uncased/resolve/main/tokenizer_config.json from cache at /root/.cache/huggingface/transformers/c1d7f0a763fb63861cc08553866f1fc3e5a6f4f07621be277452d26d71303b7e.20430bd8e10ef77a7d2977accefe796051e01bc2fc4aa146bc862997a1a15e79\n", 2792 | "Initializing bert-base-uncased as a decoder model. Cross attention layers are added to bert-base-uncased and randomly initialized if bert-base-uncased's architecture allows for cross attention layers.\n", 2793 | "Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config\n" 2794 | ] 2795 | } 2796 | ] 2797 | }, 2798 | { 2799 | "cell_type": "markdown", 2800 | "source": [ 2801 | "" 2802 | ], 2803 | "metadata": { 2804 | "id": "44370c_wMnm6" 2805 | } 2806 | }, 2807 | { 2808 | "cell_type": "markdown", 2809 | "source": [ 2810 | "## Preprocess of data\n", 2811 | "\n", 2812 | "+ データセットから含意ラベルのデータだけを抽出\n", 2813 | "+ 使用しないカラムを削除\n", 2814 | "+ データセットのカラム名を変更" 2815 | ], 2816 | "metadata": { 2817 | "id": "fFtGH7bvNHka" 2818 | } 2819 | }, 2820 | { 2821 | "cell_type": "code", 2822 | "source": [ 2823 | "raw_datasets = load_dataset(\"multi_nli\")\n", 2824 | "generation_datasets = raw_datasets.filter(lambda x:x[\"label\"]==1)\n", 2825 | "generation_datasets = generation_datasets.remove_columns(\n", 2826 | " [\"promptID\",\"pairID\",\"premise_binary_parse\",\"premise_parse\",\"hypothesis_binary_parse\", \"hypothesis_parse\",\"genre\", \"label\"]\n", 2827 | ")\n", 2828 | "generation_datasets = generation_datasets.rename_column(\"hypothesis\", \"input\")\n", 2829 | "generation_datasets = generation_datasets.rename_column(\"premise\", \"label\")\n", 2830 | "generation_datasets[\"train\"][0]" 2831 | ], 2832 | "metadata": { 2833 | "colab": { 2834 | "base_uri": "https://localhost:8080/", 2835 | "height": 214, 2836 | "referenced_widgets": [ 2837 | "2200195c39054a4a95f553a822c3ca4a", 2838 | "0c676fd14879444abd54f70bf1a2326a", 2839 | "f255b11d880f4f958d57fce7293aaf6d", 2840 | "254562c035fc4d958587f456bcc7b8d2", 2841 | "e59046c976ab46f78596f4c630cc2263", 2842 | "685e506dd03643fb84459c0e02de6cbe", 2843 | "af7d8ecd0b2e4f9fa154596a909ddf1e", 2844 | "a632d87f60254c238d2d4db3cf1bcd03", 2845 | "acee3404b44e4aecac9dcbd36e058280", 2846 | "0c4b7491f39641ab86c49efa9151a71e", 2847 | "7404eb799d1a457d8e43f766d6c5e174", 2848 | "52a9cf4f584a4f1b8580a2bbd8759e57", 2849 | "54ad317700f3474092450fc7d32663d9", 2850 | "5263698f1ce34054be5d2d6a0a5bc76b", 2851 | "91c2e2811bad43ee8f055acca9bda414", 2852 | "ff9b6eda171546ea99c338da68b45ee6", 2853 | "d53e7f33fc57487a86cc2ebe66d2db57", 2854 | "844d2c9d36d24cec946d5150410009e5", 2855 | "27a2507f5b4545df8ca658ad762dbbc7", 2856 | "e5001084807c4831a22cc7b00edeb483", 2857 | "d174cc1c593243a6aaff0365bba33baf", 2858 | "8f5940e21b6344249acb11d0470d9422", 2859 | "7794f5a424ac4072aee88f31e09e1e43", 2860 | "d129033ce907443cb225703019488771", 2861 | "fc77432baff54b39901b868545422cba", 2862 | "9a2152ab441d4df99b1cd45660f9fd94", 2863 | "213266ab59fa4c2eb1bd825d173df309", 2864 | "35d662bc09134d9c9e0df17551f4d424", 2865 | "de7c9c356d464fb3919cb3963acd6681", 2866 | "fd1387ff2d4041dc89ee1be1cbd6f009", 2867 | "0a67ca03a2aa42a3992e230d7d74471b", 2868 | "0fe377abfcfe4c4ca8478fbe12cc73c1", 2869 | "1e34d874c513479292fdfff54cf3c635", 2870 | "f426ad93ecef450b989f545ac2f3f384", 2871 | "6706b8c4486e4041932a4fed66b03d73", 2872 | "003de4ed5051453cb621e0a220a96e43", 2873 | "c57c9843e9f3450e8e5049d7af3082bb", 2874 | "6e010421305144adba37845f17645440", 2875 | "00cb0b13b04f4d9084fccbff7be6df03", 2876 | "c9194f2ed9b648e49eb83256bbbf5c47", 2877 | "df4578b45bc64931a05b2fa1fd85ef6e", 2878 | "bb5dbbb1de40411ab7503d1262b3cde9", 2879 | "5f5d6b430d284e7c996fa98a115c96bb", 2880 | "e67a67b21c6c4985a4933554354bf11e" 2881 | ] 2882 | }, 2883 | "id": "UXladez3WheU", 2884 | "outputId": "c11e300c-94c0-41ab-fc65-d48f9d519c21" 2885 | }, 2886 | "execution_count": null, 2887 | "outputs": [ 2888 | { 2889 | "output_type": "stream", 2890 | "name": "stderr", 2891 | "text": [ 2892 | "Using custom data configuration default\n", 2893 | "Reusing dataset multi_nli (/root/.cache/huggingface/datasets/multi_nli/default/0.0.0/591f72eb6263d1ab527561777936b199b714cda156d35716881158a2bd144f39)\n" 2894 | ] 2895 | }, 2896 | { 2897 | "output_type": "display_data", 2898 | "data": { 2899 | "text/plain": [ 2900 | " 0%| | 0/3 [00:00\n", 3009 | "
\n", 3010 | "
\n", 3011 | "\n", 3024 | "\n", 3025 | " \n", 3026 | " \n", 3027 | " \n", 3028 | " \n", 3029 | " \n", 3030 | " \n", 3031 | " \n", 3032 | " \n", 3033 | " \n", 3034 | " \n", 3035 | " \n", 3036 | " \n", 3037 | " \n", 3038 | " \n", 3039 | "
inputslabel
0Stevens was a talkative guy, and many couldn't...You Stevens shut your trap! Muller's roar brou...
\n", 3040 | "
\n", 3041 | " \n", 3051 | " \n", 3052 | " \n", 3089 | "\n", 3090 | " \n", 3114 | "
\n", 3115 | " \n", 3116 | " " 3117 | ] 3118 | }, 3119 | "metadata": {}, 3120 | "execution_count": 31 3121 | } 3122 | ] 3123 | }, 3124 | { 3125 | "cell_type": "markdown", 3126 | "source": [ 3127 | "## 入力テキストと出力ラベル(文)をそれぞれencodeして学習,評価データを作成" 3128 | ], 3129 | "metadata": { 3130 | "id": "cUYHWt6eNnMD" 3131 | } 3132 | }, 3133 | { 3134 | "cell_type": "code", 3135 | "source": [ 3136 | "inputs = tokenizer.batch_encode_plus(\n", 3137 | " df_dataset[\"inputs\"].tolist(),\n", 3138 | " return_tensors=\"pt\", \n", 3139 | " add_special_tokens=False,\n", 3140 | " truncation=True,\n", 3141 | " padding=\"max_length\",\n", 3142 | " max_length=256\n", 3143 | " )\n", 3144 | "labels = tokenizer.batch_encode_plus(\n", 3145 | " df_dataset[\"label\"].tolist(),\n", 3146 | " return_tensors=\"pt\", \n", 3147 | " add_special_tokens=True,\n", 3148 | " truncation=True,\n", 3149 | " padding=\"max_length\",\n", 3150 | " max_length=256\n", 3151 | " )\n", 3152 | "train_data = []\n", 3153 | "for i in range(len(inputs[\"input_ids\"])):\n", 3154 | " train_data.append(\n", 3155 | " {\n", 3156 | " \"input_ids\":inputs[\"input_ids\"][i],\n", 3157 | " \"token_type_ids\":inputs[\"token_type_ids\"][i],\n", 3158 | " \"attention_mask\":inputs[\"attention_mask\"][i],\n", 3159 | " \"label\":labels[\"input_ids\"][i] \n", 3160 | " }\n", 3161 | " )\n", 3162 | "random.shuffle(train_data)\n", 3163 | "train_size = int(len(train_data)*0.98)\n", 3164 | "eval_data = train_data[train_size:]" 3165 | ], 3166 | "metadata": { 3167 | "id": "ZKHuFNey7YTG" 3168 | }, 3169 | "execution_count": null, 3170 | "outputs": [] 3171 | }, 3172 | { 3173 | "cell_type": "markdown", 3174 | "source": [ 3175 | "## model configuration" 3176 | ], 3177 | "metadata": { 3178 | "id": "KcMaW-p5Nw-D" 3179 | } 3180 | }, 3181 | { 3182 | "cell_type": "code", 3183 | "source": [ 3184 | "generation_model.config.decoder_start_token_id = tokenizer.cls_token_id\n", 3185 | "generation_model.config.eos_token_id = tokenizer.sep_token_id\n", 3186 | "generation_model.config.pad_token_id = tokenizer.pad_token_id\n", 3187 | "# sensible parameters for beam search\n", 3188 | "generation_model.config.vocab_size = generation_model.config.decoder.vocab_size\n", 3189 | "generation_model.config.max_length = 100\n", 3190 | "generation_model.config.min_length = 20\n", 3191 | "generation_model.config.no_repeat_ngram_size = 1\n", 3192 | "generation_model.config.early_stopping = True\n", 3193 | "generation_model.config.length_penalty = 2.0\n", 3194 | "generation_model.config.num_beams = 20\n" 3195 | ], 3196 | "metadata": { 3197 | "id": "L5seOKthX74U" 3198 | }, 3199 | "execution_count": null, 3200 | "outputs": [] 3201 | }, 3202 | { 3203 | "cell_type": "markdown", 3204 | "source": [ 3205 | "## Training\n", 3206 | "\n", 3207 | "+ 生成モデルはSeq2SeqTrainerを使う\n", 3208 | "+ 自分でbackward()の処理を書いても可" 3209 | ], 3210 | "metadata": { 3211 | "id": "0adljFa_N0cr" 3212 | } 3213 | }, 3214 | { 3215 | "cell_type": "code", 3216 | "source": [ 3217 | "# Train Param\n", 3218 | "batch_size = 8\n", 3219 | "generation_model.train()\n", 3220 | "# https://huggingface.co/docs/transformers/main_classes/trainer#transformers.Seq2SeqTrainingArguments\n", 3221 | "training_args = Seq2SeqTrainingArguments(\n", 3222 | " output_dir='./',\n", 3223 | " evaluation_strategy=\"steps\",\n", 3224 | " per_device_train_batch_size=batch_size,\n", 3225 | " per_device_eval_batch_size=batch_size,\n", 3226 | " predict_with_generate=True,\n", 3227 | " logging_steps=10,\n", 3228 | " save_steps=30,\n", 3229 | " eval_steps=5000,\n", 3230 | " warmup_steps=1000,\n", 3231 | " overwrite_output_dir=True,\n", 3232 | " save_total_limit=5,\n", 3233 | " fp16=False,\n", 3234 | " num_train_epochs=3,\n", 3235 | " no_cuda=not CUDA_AVAILABLE\n", 3236 | ")\n", 3237 | "\n", 3238 | "# instantiate trainer\n", 3239 | "trainer = Seq2SeqTrainer(\n", 3240 | " model=generation_model,\n", 3241 | " tokenizer=tokenizer,\n", 3242 | " args=training_args,\n", 3243 | " train_dataset=train_data,\n", 3244 | " eval_dataset=eval_data\n", 3245 | ")\n", 3246 | "trainer.train()" 3247 | ], 3248 | "metadata": { 3249 | "colab": { 3250 | "base_uri": "https://localhost:8080/", 3251 | "height": 529 3252 | }, 3253 | "id": "rGEGsIfUVbmj", 3254 | "outputId": "53508fa9-926e-437a-d669-98853a52955d" 3255 | }, 3256 | "execution_count": null, 3257 | "outputs": [ 3258 | { 3259 | "output_type": "stream", 3260 | "name": "stderr", 3261 | "text": [ 3262 | "PyTorch: setting up devices\n", 3263 | "The default value for the training argument `--report_to` will change in v5 (from all installed integrations to none). In v5, you will need to use `--report_to all` to get the same behavior as now. You should start updating your code and make this info disappear :-).\n", 3264 | "/usr/local/lib/python3.7/dist-packages/transformers/optimization.py:309: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning\n", 3265 | " FutureWarning,\n", 3266 | "***** Running training *****\n", 3267 | " Num examples = 100\n", 3268 | " Num Epochs = 3\n", 3269 | " Instantaneous batch size per device = 8\n", 3270 | " Total train batch size (w. parallel, distributed & accumulation) = 8\n", 3271 | " Gradient Accumulation steps = 1\n", 3272 | " Total optimization steps = 39\n", 3273 | "The following columns in the training set don't have a corresponding argument in `EncoderDecoderModel.forward` and have been ignored: token_type_ids. If token_type_ids are not expected by `EncoderDecoderModel.forward`, you can safely ignore this message.\n", 3274 | "/usr/local/lib/python3.7/dist-packages/transformers/models/encoder_decoder/modeling_encoder_decoder.py:532: FutureWarning: Version v4.12.0 introduces a better way to train encoder-decoder models by computing the loss inside the encoder-decoder framework rather than in the decoder itself. You may observe training discrepancies if fine-tuning a model trained with versions anterior to 4.12.0. The decoder_input_ids are now created based on the labels, no need to pass them yourself anymore.\n", 3275 | " warnings.warn(DEPRECATION_WARNING, FutureWarning)\n" 3276 | ] 3277 | }, 3278 | { 3279 | "output_type": "display_data", 3280 | "data": { 3281 | "text/plain": [ 3282 | "" 3283 | ], 3284 | "text/html": [ 3285 | "\n", 3286 | "
\n", 3287 | " \n", 3288 | " \n", 3289 | " [39/39 00:45, Epoch 3/3]\n", 3290 | "
\n", 3291 | " \n", 3292 | " \n", 3293 | " \n", 3294 | " \n", 3295 | " \n", 3296 | " \n", 3297 | " \n", 3298 | " \n", 3299 | " \n", 3300 | " \n", 3301 | "
StepTraining LossValidation Loss

" 3302 | ] 3303 | }, 3304 | "metadata": {} 3305 | }, 3306 | { 3307 | "output_type": "stream", 3308 | "name": "stderr", 3309 | "text": [ 3310 | "Saving model checkpoint to ./checkpoint-30\n", 3311 | "tokenizer config file saved in ./checkpoint-30/tokenizer_config.json\n", 3312 | "Special tokens file saved in ./checkpoint-30/special_tokens_map.json\n", 3313 | "/usr/local/lib/python3.7/dist-packages/transformers/models/encoder_decoder/modeling_encoder_decoder.py:532: FutureWarning: Version v4.12.0 introduces a better way to train encoder-decoder models by computing the loss inside the encoder-decoder framework rather than in the decoder itself. You may observe training discrepancies if fine-tuning a model trained with versions anterior to 4.12.0. The decoder_input_ids are now created based on the labels, no need to pass them yourself anymore.\n", 3314 | " warnings.warn(DEPRECATION_WARNING, FutureWarning)\n", 3315 | "\n", 3316 | "\n", 3317 | "Training completed. Do not forget to share your model on huggingface.co/models =)\n", 3318 | "\n", 3319 | "\n" 3320 | ] 3321 | }, 3322 | { 3323 | "output_type": "execute_result", 3324 | "data": { 3325 | "text/plain": [ 3326 | "TrainOutput(global_step=39, training_loss=10.61686765230619, metrics={'train_runtime': 46.3326, 'train_samples_per_second': 6.475, 'train_steps_per_second': 0.842, 'total_flos': 92018115072000.0, 'train_loss': 10.61686765230619, 'epoch': 3.0})" 3327 | ] 3328 | }, 3329 | "metadata": {}, 3330 | "execution_count": 34 3331 | } 3332 | ] 3333 | }, 3334 | { 3335 | "cell_type": "markdown", 3336 | "source": [ 3337 | "# Read created model" 3338 | ], 3339 | "metadata": { 3340 | "id": "S0JLo1oIODgT" 3341 | } 3342 | }, 3343 | { 3344 | "cell_type": "code", 3345 | "source": [ 3346 | "created_model = generation_model.from_pretrained(\"./checkpoint-30\")" 3347 | ], 3348 | "metadata": { 3349 | "id": "X3fpsZJo-05X" 3350 | }, 3351 | "execution_count": null, 3352 | "outputs": [] 3353 | }, 3354 | { 3355 | "cell_type": "markdown", 3356 | "source": [ 3357 | "## Generate entailment sentence" 3358 | ], 3359 | "metadata": { 3360 | "id": "Izd6o18xOFtb" 3361 | } 3362 | }, 3363 | { 3364 | "cell_type": "code", 3365 | "source": [ 3366 | "tokenized = tokenizer(df_dataset[\"inputs\"][0], return_tensors=\"pt\", truncation=True, padding=True, max_length=256)\n", 3367 | "pred = created_model.generate(tokenized[\"input_ids\"])\n", 3368 | "pred" 3369 | ], 3370 | "metadata": { 3371 | "colab": { 3372 | "base_uri": "https://localhost:8080/" 3373 | }, 3374 | "id": "yhFMvdOw_UfI", 3375 | "outputId": "2ad95288-bad5-4961-9139-e0e2b64d4ae8" 3376 | }, 3377 | "execution_count": null, 3378 | "outputs": [ 3379 | { 3380 | "output_type": "execute_result", 3381 | "data": { 3382 | "text/plain": [ 3383 | "tensor([[ 101, 1996, 1012, 1025, 999, 1010, 1585, 30112, 30114, 1584,\n", 3384 | " 1586, 30111, 27876, 1583, 1587, 30132, 30130, 30129, 30131, 1141,\n", 3385 | " 1536, 25292, 1592, 30113, 1591, 19174, 1064, 4414, 1621, 17928,\n", 3386 | " 3031, 1588, 28637, 8778, 1607, 11916, 20955, 2004, 3022, 2133,\n", 3387 | " 18880, 16302, 13811, 27362, 2000, 2830, 8848, 2091, 2067, 2101,\n", 3388 | " 2083, 2627, 11165, 24288, 29053, 29051, 1998, 5685, 26379, 2664,\n", 3389 | " 16808, 5743, 15834, 7652, 19442, 25430, 13366, 1510, 4125, 2368,\n", 3390 | " 24333, 12942, 2046, 10359, 22625, 25693, 17741, 3413, 5235, 4084,\n", 3391 | " 10024, 22953, 26864, 11563, 4063, 15454, 5441, 2663, 2062, 22302,\n", 3392 | " 5963, 3553, 20755, 13806, 13776, 2721, 10278, 7367, 2061, 5879]])" 3393 | ] 3394 | }, 3395 | "metadata": {}, 3396 | "execution_count": 36 3397 | } 3398 | ] 3399 | }, 3400 | { 3401 | "cell_type": "markdown", 3402 | "source": [ 3403 | "## Decode predicted tensors" 3404 | ], 3405 | "metadata": { 3406 | "id": "dHAPe4MqONG6" 3407 | } 3408 | }, 3409 | { 3410 | "cell_type": "code", 3411 | "source": [ 3412 | "df_dataset[\"inputs\"][0], tokenizer.decode(pred[0], skip_special_tokens=True, truncation=True, padding=True, max_length=256)" 3413 | ], 3414 | "metadata": { 3415 | "colab": { 3416 | "base_uri": "https://localhost:8080/" 3417 | }, 3418 | "id": "fiiERZY3AK23", 3419 | "outputId": "6ec40ff3-c3e3-4ca6-d1dc-a487671c20f4" 3420 | }, 3421 | "execution_count": null, 3422 | "outputs": [ 3423 | { 3424 | "output_type": "execute_result", 3425 | "data": { 3426 | "text/plain": [ 3427 | "(\"Stevens was a talkative guy, and many couldn't stand him.\",\n", 3428 | " 'the. ;!, →↑↓ ↑ ↓←missive ← ↔∪∨∧∩ ʲ ⁰ vis ∂→ ⇒ nanny | respectively ☆ api onto ↦gree protocol ≡ency hartley asas... pasadenacare dominancerath to forward backward down back later through past successive successively travers hays andandndt yet moor forth onwardwardbeat sw def ᵥ riseenfastlum intolike fidelity gorman mcmahon pass passes stepsbra bro barnetnderder reject maintain win more hotterback closeribelatelatedlalam se so norman')" 3429 | ] 3430 | }, 3431 | "metadata": {}, 3432 | "execution_count": 37 3433 | } 3434 | ] 3435 | }, 3436 | { 3437 | "cell_type": "markdown", 3438 | "source": [ 3439 | "# Option" 3440 | ], 3441 | "metadata": { 3442 | "id": "JC87qnJeORy0" 3443 | } 3444 | }, 3445 | { 3446 | "cell_type": "markdown", 3447 | "source": [ 3448 | "+ \"pytorch_tutorial.ipynb\"を\"pytorch_tutorial.py\"に変換するコマンド\n", 3449 | "\n", 3450 | "```jupyter nbconvert --to script pytorch_tutorial.ipynb```\n", 3451 | "\n", 3452 | "+ 使うGPUを指定して実行する方法(os.environでも可)\n", 3453 | "+ 特にTrainerは視えてるGPUを全て使うので指定してあげる必要がある.\n", 3454 | "+ GPU:0~2を使って実行したい場合\n", 3455 | "\n", 3456 | "```CUDA_VISIBLE_DEVICES=0,1,2 python pytorch_tutorial.py ```" 3457 | ], 3458 | "metadata": { 3459 | "id": "doolAe-7OXGj" 3460 | } 3461 | } 3462 | ] 3463 | } --------------------------------------------------------------------------------