File size: 29,941 Bytes
38f7d61 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 |
{
"cells": [
{
"cell_type": "markdown",
"id": "f2299629",
"metadata": {},
"source": [
"# It is a template for applying CPICANN to X-ray powder diffraction phase identification"
]
},
{
"cell_type": "markdown",
"id": "cad44131",
"metadata": {},
"source": [
"### 1: install WPEMPhase package "
]
},
{
"cell_type": "markdown",
"id": "af59fa9d",
"metadata": {},
"source": [
"pip install WPEMPhase"
]
},
{
"cell_type": "markdown",
"id": "7d9d6d02",
"metadata": {},
"source": [
"### 2: The first time you execute CPICANN on your computer, you should initialize the system documents. After that, you do not need to do any additional execution to run CPICANN."
]
},
{
"cell_type": "raw",
"id": "4787c1b4",
"metadata": {},
"source": [
"Signature:\n",
"CPICANN.PhaseIdentifier(\n",
" FilePath,\n",
" Task='single-phase',\n",
" Model='default',\n",
" ElementsSystem='',\n",
" ElementsContained='',\n",
" Device='cuda:0',\n",
")\n",
"Docstring:\n",
"CPICANN : Crystallographic Phase Identifier of Convolutional self-Attention Neural Network\n",
"\n",
"Contributors : Shouyang Zhang & Bin Cao\n",
"================================================================\n",
" Please feel free to open issues in the Github :\n",
" https://github.com/WPEM/CPICANN\n",
" or\n",
" contact Mr.Bin Cao (bcao686@connect.hkust-gz.edu.cn)\n",
" in case of any problems/comments/suggestions in using the code.\n",
"==================================================================\n",
"\n",
":param FilePath\n",
"\n",
":param Task, type=str, default='single-phase'\n",
" if Task = 'single-phase', CPICANN executes a single phase identification task\n",
" if Task = 'di-phase', CPICANN executes a dual phase identification task\n",
"\n",
":param Model, type=str, default='default'\n",
" if Model = 'noise_model', CPICANN executes a single phase identification by noise-contained model\n",
" if Model = 'bca_model', CPICANN executes a single phase identification by background-contained model\n",
"\n",
":param ElementsSystem, type=str, default=''\n",
" Specifies the elements to be included at least in the prediction, example: 'Fe'.\n",
"\n",
":param ElementsContained, type=str, default=''\n",
" Specifies the elements to be included, with at least one of them in the prediction, example: 'O_C_S'.\n",
"\n",
":param Device, type=str, default='cuda:0',\n",
" Which device to run the CPICANN, example: 'cuda:0', 'cpu'.\n",
"\n",
"examples:\n",
"from WPEMPhase import CPICANN\n",
"CPICANN.PhaseIdentifier(FilePath='./single-phase',Device='cpu')\n",
"File: ~/miniconda3/lib/python3.9/site-packages/WPEMPhase/CPICANN.py\n",
"Type: function"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "0922c99d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting WPEMPhase\n",
" Downloading WPEMPhase-0.1.0-py3-none-any.whl.metadata (1.0 kB)\n",
"Requirement already satisfied: torch in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (2.0.0)\n",
"Requirement already satisfied: plot in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (0.6.5)\n",
"Requirement already satisfied: scipy in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (1.9.3)\n",
"Requirement already satisfied: pandas in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (1.5.1)\n",
"Requirement already satisfied: numpy in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (1.23.3)\n",
"Requirement already satisfied: art in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (6.1)\n",
"Requirement already satisfied: pymatgen in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (2023.3.23)\n",
"Requirement already satisfied: wget in /Users/jacob/miniconda3/lib/python3.9/site-packages (from WPEMPhase) (3.2)\n",
"Requirement already satisfied: python-dateutil>=2.8.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pandas->WPEMPhase) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pandas->WPEMPhase) (2022.5)\n",
"Requirement already satisfied: matplotlib in /Users/jacob/miniconda3/lib/python3.9/site-packages (from plot->WPEMPhase) (3.7.1)\n",
"Requirement already satisfied: typing in /Users/jacob/miniconda3/lib/python3.9/site-packages (from plot->WPEMPhase) (3.7.4.3)\n",
"Requirement already satisfied: pyyaml in /Users/jacob/miniconda3/lib/python3.9/site-packages (from plot->WPEMPhase) (6.0)\n",
"Requirement already satisfied: monty>=3.0.2 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (2023.4.10)\n",
"Requirement already satisfied: mp-api>=0.27.3 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (0.31.2)\n",
"Requirement already satisfied: networkx>=2.2 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (2.8.8)\n",
"Requirement already satisfied: palettable>=3.1.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (3.3.3)\n",
"Requirement already satisfied: plotly>=4.5.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (5.14.1)\n",
"Requirement already satisfied: pybtex in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (0.24.0)\n",
"Requirement already satisfied: requests in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (2.28.2)\n",
"Requirement already satisfied: ruamel.yaml>=0.17.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (0.17.21)\n",
"Requirement already satisfied: spglib>=2.0.2 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (2.0.2)\n",
"Requirement already satisfied: sympy in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (1.11.1)\n",
"Requirement already satisfied: tabulate in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (0.9.0)\n",
"Requirement already satisfied: tqdm in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (4.66.1)\n",
"Requirement already satisfied: uncertainties>=3.1.4 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pymatgen->WPEMPhase) (3.1.7)\n",
"Requirement already satisfied: filelock in /Users/jacob/miniconda3/lib/python3.9/site-packages (from torch->WPEMPhase) (3.10.7)\n",
"Requirement already satisfied: typing-extensions in /Users/jacob/miniconda3/lib/python3.9/site-packages (from torch->WPEMPhase) (4.11.0)\n",
"Requirement already satisfied: jinja2 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from torch->WPEMPhase) (3.1.2)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (1.0.5)\n",
"Requirement already satisfied: cycler>=0.10 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (0.11.0)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (4.38.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (1.4.4)\n",
"Requirement already satisfied: packaging>=20.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (23.0)\n",
"Requirement already satisfied: pillow>=6.2.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (9.5.0)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (3.0.9)\n",
"Requirement already satisfied: importlib-resources>=3.2.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from matplotlib->plot->WPEMPhase) (5.12.0)\n",
"Requirement already satisfied: setuptools in /Users/jacob/miniconda3/lib/python3.9/site-packages (from mp-api>=0.27.3->pymatgen->WPEMPhase) (67.6.1)\n",
"Requirement already satisfied: msgpack in /Users/jacob/miniconda3/lib/python3.9/site-packages (from mp-api>=0.27.3->pymatgen->WPEMPhase) (1.0.5)\n",
"Requirement already satisfied: emmet-core<=0.50.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from mp-api>=0.27.3->pymatgen->WPEMPhase) (0.50.0)\n",
"Requirement already satisfied: tenacity>=6.2.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from plotly>=4.5.0->pymatgen->WPEMPhase) (8.2.2)\n",
"Requirement already satisfied: six>=1.5 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from python-dateutil>=2.8.1->pandas->WPEMPhase) (1.16.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from requests->pymatgen->WPEMPhase) (2.0.4)\n",
"Requirement already satisfied: idna<4,>=2.5 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from requests->pymatgen->WPEMPhase) (3.3)\n",
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from requests->pymatgen->WPEMPhase) (1.26.9)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from requests->pymatgen->WPEMPhase) (2022.12.7)\n",
"Requirement already satisfied: ruamel.yaml.clib>=0.2.6 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from ruamel.yaml>=0.17.0->pymatgen->WPEMPhase) (0.2.6)\n",
"Requirement already satisfied: future in /Users/jacob/miniconda3/lib/python3.9/site-packages (from uncertainties>=3.1.4->pymatgen->WPEMPhase) (0.18.3)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from jinja2->torch->WPEMPhase) (2.1.1)\n",
"Requirement already satisfied: latexcodec>=1.0.4 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from pybtex->pymatgen->WPEMPhase) (2.0.1)\n",
"Requirement already satisfied: mpmath>=0.19 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from sympy->pymatgen->WPEMPhase) (1.3.0)\n",
"Requirement already satisfied: pydantic>=1.10.2 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from emmet-core<=0.50.0->mp-api>=0.27.3->pymatgen->WPEMPhase) (1.10.7)\n",
"Requirement already satisfied: zipp>=3.1.0 in /Users/jacob/miniconda3/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib->plot->WPEMPhase) (3.9.0)\n",
"Downloading WPEMPhase-0.1.0-py3-none-any.whl (710 kB)\n",
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m710.2/710.2 kB\u001b[0m \u001b[31m2.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0mm\n",
"\u001b[?25hInstalling collected packages: WPEMPhase\n",
"Successfully installed WPEMPhase-0.1.0\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install WPEMPhase"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "8e1680a6",
"metadata": {},
"outputs": [],
"source": [
"from WPEMPhase import CPICANN"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7625eb66",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is the first time CPICANN is being executed on your computer, configuring...\n",
"Downloading: 3% [24690688 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 7% [61341696 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 13% [107954176 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 19% [148324352 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 24% [189382656 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 28% [221265920 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 33% [262488064 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 39% [304799744 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 44% [346030080 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 50% [388333568 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 55% [429015040 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 60% [470278144 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 65% [507609088 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 70% [549601280 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 75% [587497472 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 80% [622919680 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 86% [668491776 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 89% [698474496 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 91% [713318400 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 96% [746487808 / 776454342] bytes"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"IOPub message rate exceeded.\n",
"The notebook server will temporarily stop sending output\n",
"to the client in order to avoid crashing it.\n",
"To change this limit, set the config variable\n",
"`--NotebookApp.iopub_msg_rate_limit`.\n",
"\n",
"Current values:\n",
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
"NotebookApp.rate_limit_window=3.0 (secs)\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 100% [776454342 / 776454342] bytes ____ ____ ___ ____ _ _ _ _ _ \n",
" / ___|| _ \\ |_ _| / ___| / \\ | \\ | || \\ | |\n",
"| | | |_) | | | | | / _ \\ | \\| || \\| |\n",
"| |___ | __/ | | | |___ / ___ \\ | |\\ || |\\ |\n",
" \\____||_| |___| \\____|/_/ \\_\\|_| \\_||_| \\_|\n",
" \n",
"\n",
"The phase identification module of WPEM\n",
"URL : https://github.com/WPEM/CPICANN\n",
"Executed on : 2024-04-21 14:14:25 | Have a great day.\n",
"================================================================================\n",
"loaded model from /Users/jacob/miniconda3/lib/python3.9/site-packages/WPEMPhase/pretrained/CPICANN_single-phase_back3.pth\n",
"\n",
">>>>>> RUNNING: ./testdata/.DS_Store\n",
"\n",
">>>>>> RUNNING: ./testdata/PbSO4.csv\n",
"pred cls_id : 2475 confidence : 98.89%\n",
"pred cod_id : 9009622 formula : Pb2 S2 O6\n",
"pred space group No: 11 space group : P2_1/m\n",
"\n",
"inference result saved in infResults_testdata.csv\n",
"inference figures saved at figs/\n",
"THE END\n"
]
},
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Here, illustrate the system requirements and how to initialize the system files at the first time of execution.\n",
"\n",
"CPICANN.PhaseIdentifier(FilePath='./testdata',Model='bca_model',Task='single-phase',Device='cpu',)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "304b62b5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" ____ ____ ___ ____ _ _ _ _ _ \n",
" / ___|| _ \\ |_ _| / ___| / \\ | \\ | || \\ | |\n",
"| | | |_) | | | | | / _ \\ | \\| || \\| |\n",
"| |___ | __/ | | | |___ / ___ \\ | |\\ || |\\ |\n",
" \\____||_| |___| \\____|/_/ \\_\\|_| \\_||_| \\_|\n",
" \n",
"\n",
"The phase identification module of WPEM\n",
"URL : https://github.com/WPEM/CPICANN\n",
"Executed on : 2024-04-21 14:14:53 | Have a great day.\n",
"================================================================================\n",
"loaded model from /Users/jacob/miniconda3/lib/python3.9/site-packages/WPEMPhase/pretrained/CPICANN_single-phase_noise3.pth\n",
"\n",
">>>>>> RUNNING: ./testdata/.DS_Store\n",
"\n",
">>>>>> RUNNING: ./testdata/PbSO4.csv\n",
"pred cls_id : 3378 confidence : 100.00%\n",
"pred cod_id : 9004484 formula : Pb4 S4 O16\n",
"pred space group No: 62 space group : Pnma\n",
"\n",
"inference result saved in infResults_testdata.csv\n",
"inference figures saved at figs/\n",
"THE END\n"
]
},
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from WPEMPhase import CPICANN\n",
"# Here, illustrate the system requirements and how to initialize the system files at the first time of execution.\n",
"\n",
"CPICANN.PhaseIdentifier(FilePath='./testdata',Model='noise_model',Task='single-phase',ElementsContained='Pb_S_O',Device='cpu',)"
]
},
{
"cell_type": "raw",
"id": "977ede12",
"metadata": {},
"source": [
"For inquiries or assistance, please don't hesitate to contact us at bcao686@connect.hkust-gz.edu.cn (Dr. CAO Bin)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bb101480",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|