{ "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 }