{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "0d19012c", "metadata": {}, "source": [ "# Hetero-NN Customize your Dataset\n", "\n", "The FATE system primarily supports tabular data as its standard data format. However, it is possible to utilize non-tabular data, such as images, text, mixed data, or relational data, in neural networks through the use of the Dataset feature of the NN module. The Dataset module within the NN module allows for the customization of datasets so that user can use them in more complex data scenarios. This tutorial will cover the use of the Dataset feature in the Hetero-NN. For the ease of demonstration, We will use the MNIST handwriting recognition dataset as an example to simulate a Hetero Federation task to illustrate these concepts. " ] }, { "cell_type": "markdown", "id": "2122f107", "metadata": {}, "source": [ "## Prepare MNIST Data\n", "\n", "Please download the guest/host MNIST dataset from the link below and place it in the project examples/data folder:\n", "\n", "- guest data: https://webank-ai-1251170195.cos.ap-guangzhou.myqcloud.com/fate/examples/data/mnist_guest.zip\n", "\n", "- host data: https://webank-ai-1251170195.cos.ap-guangzhou.myqcloud.com/fate/examples/data/mnist_host.zip\n", "\n", "The mnist_guest is a simplified version of the MNIST dataset, with a total of ten categories, which are classified into 0-9 10 folders according to labels. The mnist_host has the same images as the mnist_guest, but it is not labeled." ] }, { "cell_type": "code", "execution_count": 3, "id": "87b15585", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 1 2 3 4 5 6 7\t8 9\n" ] } ], "source": [ "! ls ../../../../examples/data/mnist_guest" ] }, { "cell_type": "code", "execution_count": 4, "id": "0eae2710", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "not_labeled\n" ] } ], "source": [ "! ls ../../../../examples/data/mnist_host" ] }, { "cell_type": "markdown", "id": "a2cc655b", "metadata": {}, "source": [ "## Dataset\n", "\n", "In version FATE-1.10, FATE introduces a new base class for datasets called Dataset, which is based on PyTorch's Dataset class. This class allows users to create custom datasets according to their specific needs. The usage is similar to that of PyTorch's Dataset class, with the added requirement of implementing two additional interfaces when using FATE-NN for data reading and training: load() and get_sample_ids().\n", "\n", "To create a custom dataset in Hetero-NN, users need to:\n", "\n", "- Develop a new dataset class that inherits from the Dataset class\n", "- Implement the \\_\\_len\\_\\_() and \\_\\_getitem\\_\\_() methods, which are consistent with PyTorch's Dataset usage. The \\_\\_len\\_\\_() method should return the length of the dataset, while the \\_\\_getitem\\_\\_() method should return the corresponding data at the specified index. **However, please notice that different \\_\\_getitem\\_\\_() methods may have different behaviors between different parties. In the guest party(party with labels), _\\_getitem\\_\\_() method return features and labels, while in the host parties(parties without label), _\\_getitem\\_\\_() method return features only.** \n", "- Implement the load(), get_sample_ids(), get_classes() methods\n", " \n", "For those unfamiliar with PyTorch's Dataset class, more information can be found in the PyTorch documentation: [Pytorch Dataset Documentation](https://pytorch.org/tutorials/beginner/basics/data_tutorial.html)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "028a993a", "metadata": {}, "source": [ "### load()\n", "\n", "The first additional interface required is load(). This interface receives a file path and allows users to read data directly from the local file system. When submitting a task, the data path can be specified through the reader component. Hetero-NN will use the user-specified Dataset class, utilizing the load() interface to read data from the specified path and complete the loading of the dataset for training. For more information, please refer to the source code in [/federatedml/nn/dataset/base.py](../../../../python/federatedml/nn/dataset/base.py).\n", "\n", "### get_sample_ids()\n", "\n", "The second additional interface is get_sample_ids(). This interface should return a list of sample IDs, which can be either integers or strings and should have the same length as the dataset. This function is important in Hetero-NN, there are some points you need to know:\n", "\n", "- **When using a customized dataset in Hetero-NN, it is important to ensure that your sample IDs are aligned with those of other parties. You can do this by using the intersection component and extracting the results, or by agreeing on the sample IDs to be used with the other parties.**\n", "- **You don't have to put your ids in order, Hetero-NN component will sort them.** \n", "\n", "### get_classes\n", "\n", "The third function return a list of all unique labels. It will be called in the guest party. If it is not a classification task, just return an empty list." ] }, { "cell_type": "markdown", "id": "af86971b", "metadata": {}, "source": [ "## Example: Implement a simple image dataset\n", "\n", "In order to better understand the customization of Dataset, here we implement a simple image dataset to read MNIST images, and then complete a federated image classification task in a vertical scene.\n", "For convenience here, we use the jupyter interface of save_to_fate to update the code to federatedml.nn.dataset, named mnist_dataset.py, of course you can manually copy the code file to the directory.\n", "\n", "- This dataset has a parameter 'return_label', when guest party(party with label) is using it, we set return_label=True, else return_label=False\n", "- It is developed based on ImageFolder, and we take image name as the sample id. " ] }, { "cell_type": "code", "execution_count": 6, "id": "d2446d7f", "metadata": {}, "outputs": [], "source": [ "from pipeline.component.nn import save_to_fate" ] }, { "cell_type": "code", "execution_count": 7, "id": "f35b7c7f", "metadata": {}, "outputs": [], "source": [ "%%save_to_fate dataset mnist_dataset.py\n", "import numpy as np\n", "from federatedml.nn.dataset.base import Dataset\n", "from torchvision.datasets import ImageFolder\n", "from torchvision import transforms\n", "\n", "class MNISTDataset(Dataset):\n", " \n", " def __init__(self, return_label=True): \n", " super(MNISTDataset, self).__init__() \n", " self.return_label = return_label\n", " self.image_folder = None\n", " self.ids = None\n", " \n", " def load(self, path): \n", " \n", " self.image_folder = ImageFolder(root=path, transform=transforms.Compose([transforms.ToTensor()]))\n", " ids = []\n", " for image_name in self.image_folder.imgs:\n", " ids.append(image_name[0].split('/')[-1].replace('.jpg', ''))\n", " self.ids = ids\n", "\n", " return self\n", "\n", " def get_sample_ids(self, ):\n", " return self.ids\n", " \n", " def get_classes(self, ):\n", " return np.unique(self.image_folder.targets).tolist()\n", " \n", " def __len__(self,): \n", " return len(self.image_folder)\n", " \n", " def __getitem__(self, idx): # get item \n", " ret = self.image_folder[idx]\n", " img = ret[0][0].flatten() # flatten tensor 784 dims\n", " if self.return_label:\n", " return img, ret[1] # img & label\n", " else:\n", " return img # no label, for host" ] }, { "cell_type": "markdown", "id": "b158f298", "metadata": {}, "source": [ "Now we test our dataset class:" ] }, { "cell_type": "code", "execution_count": 10, "id": "5890ae8f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 1 2 3 4 5 6 7\t8 9\n", "1309\n", "tensor([0.0118, 0.0000, 0.0000, 0.0118, 0.0275, 0.0118, 0.0000, 0.0118, 0.0000,\n", " 0.0431, 0.0000, 0.0000, 0.0118, 0.0000, 0.0000, 0.0118, 0.0314, 0.0000,\n", " 0.0000, 0.0118, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0039,\n", " 0.0196, 0.0000, 0.0471, 0.0000, 0.0627, 0.0000, 0.0000, 0.0157, 0.0000,\n", " 0.0078, 0.0314, 0.0118, 0.0000, 0.0157, 0.0314, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000, 0.0000, 0.0039,\n", " 0.0078, 0.0039, 0.0471, 0.0000, 0.0314, 0.0000, 0.0000, 0.0235, 0.0000,\n", " 0.0431, 0.0000, 0.0000, 0.0235, 0.0275, 0.0078, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0039, 0.0118, 0.0000, 0.0000, 0.0078,\n", " 0.0118, 0.0000, 0.0000, 0.0000, 0.0471, 0.0000, 0.0000, 0.0902, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0431, 0.0118, 0.0000, 0.0000, 0.0157, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0039, 0.0039, 0.0000, 0.0000,\n", " 0.0078, 0.0000, 0.0000, 0.0235, 0.0000, 0.0980, 0.1059, 0.5333, 0.5294,\n", " 0.7373, 0.3490, 0.3294, 0.0980, 0.0000, 0.0000, 0.0118, 0.0039, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0157, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0118, 0.3451, 0.9686, 0.9255, 1.0000,\n", " 0.9765, 0.9804, 0.8902, 0.9412, 0.5333, 0.1451, 0.0039, 0.0000, 0.0078,\n", " 0.0078, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000,\n", " 0.0118, 0.0000, 0.0000, 0.0157, 0.1059, 0.7569, 0.9843, 0.9922, 1.0000,\n", " 1.0000, 1.0000, 1.0000, 0.9412, 0.9961, 1.0000, 0.8353, 0.3490, 0.0000,\n", " 0.0000, 0.0549, 0.0039, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0235, 0.0000, 0.0000, 0.0706, 0.2196, 0.9647, 1.0000, 0.9922,\n", " 0.9529, 0.9843, 1.0000, 0.9608, 1.0000, 1.0000, 0.9961, 1.0000, 0.9059,\n", " 0.4667, 0.0275, 0.0000, 0.0196, 0.0000, 0.0000, 0.0000, 0.0000, 0.0157,\n", " 0.0000, 0.0000, 0.0471, 0.0510, 0.0000, 0.2549, 0.7451, 0.9647, 1.0000,\n", " 1.0000, 0.9843, 1.0000, 0.4275, 0.3451, 0.7804, 1.0000, 0.9686, 0.9804,\n", " 1.0000, 0.9176, 0.3608, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0392, 0.0039, 0.0000, 0.0000, 0.0706, 0.6392, 0.9725, 1.0000,\n", " 0.9216, 0.8471, 0.5882, 0.5020, 0.1765, 0.0235, 0.0314, 0.0863, 0.8314,\n", " 1.0000, 1.0000, 0.9882, 0.6745, 0.0000, 0.0588, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0039, 0.0157, 0.0196, 0.0000, 0.0000, 0.7333, 1.0000,\n", " 0.9961, 0.3686, 0.2235, 0.0275, 0.0039, 0.0000, 0.0235, 0.0000, 0.0000,\n", " 0.5451, 0.9490, 1.0000, 1.0000, 0.8549, 0.2431, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0196, 0.0078, 0.0000, 0.0000, 0.0431, 0.2196, 0.9882,\n", " 0.9216, 0.9922, 0.0784, 0.0196, 0.0078, 0.0196, 0.0039, 0.0000, 0.0039,\n", " 0.0078, 0.0000, 0.3804, 0.9765, 0.9725, 0.9765, 0.6510, 0.0314, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000, 0.2745,\n", " 1.0000, 1.0000, 0.9608, 0.0980, 0.0392, 0.0000, 0.0000, 0.0039, 0.0000,\n", " 0.0157, 0.0392, 0.0000, 0.0392, 1.0000, 0.9647, 0.9804, 0.6078, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0275, 0.0471, 0.0000,\n", " 0.3412, 0.8863, 1.0000, 0.7216, 0.0000, 0.0118, 0.0000, 0.0392, 0.0196,\n", " 0.0000, 0.0000, 0.0000, 0.0353, 0.0000, 0.7176, 0.9843, 1.0000, 0.8706,\n", " 0.0588, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0196, 0.0039, 0.0000,\n", " 0.0745, 0.9020, 1.0000, 0.9529, 1.0000, 0.1373, 0.0078, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0353, 0.0314, 0.0000, 0.0000, 0.2745, 0.9608, 0.9490,\n", " 1.0000, 0.0549, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0157, 0.0118,\n", " 0.0000, 0.0745, 0.9843, 0.9373, 1.0000, 0.9686, 0.1176, 0.0039, 0.0000,\n", " 0.0157, 0.0157, 0.0549, 0.0000, 0.0000, 0.0078, 0.0000, 0.1843, 1.0000,\n", " 1.0000, 0.9686, 0.0824, 0.0000, 0.0000, 0.0000, 0.0000, 0.0235, 0.0000,\n", " 0.0078, 0.0078, 0.0000, 0.6784, 0.9686, 0.9882, 0.9804, 0.1098, 0.0392,\n", " 0.0000, 0.0000, 0.0314, 0.0000, 0.0000, 0.0000, 0.0314, 0.0000, 0.2627,\n", " 0.9765, 1.0000, 1.0000, 0.0471, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0235, 0.0118, 0.0000, 0.3451, 1.0000, 0.9843, 1.0000, 0.7373,\n", " 0.0824, 0.0000, 0.0588, 0.0000, 0.0314, 0.0078, 0.0627, 0.0000, 0.1373,\n", " 0.7843, 0.9686, 0.9843, 0.5255, 0.0157, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0118, 0.0118, 0.0039, 0.0000, 0.0431, 0.8275, 0.9686, 0.9765,\n", " 1.0000, 0.7412, 0.2980, 0.0000, 0.0000, 0.0157, 0.0000, 0.0078, 0.0000,\n", " 0.6627, 1.0000, 1.0000, 0.9686, 0.1843, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0235, 0.0000, 0.0000, 0.0078, 0.0000, 0.2314, 0.8039,\n", " 1.0000, 0.9412, 1.0000, 0.7137, 0.1608, 0.2196, 0.1098, 0.1294, 0.1647,\n", " 0.9373, 0.9647, 0.9843, 0.9333, 0.6157, 0.0000, 0.0039, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0078, 0.0039, 0.0000, 0.0000, 0.0078, 0.0392, 0.0000,\n", " 0.4078, 0.9373, 1.0000, 0.9412, 1.0000, 0.9922, 0.9686, 0.9294, 1.0000,\n", " 1.0000, 0.9804, 1.0000, 0.9373, 1.0000, 0.3922, 0.0000, 0.0039, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0039, 0.0000, 0.0118, 0.0000, 0.0000, 0.0275,\n", " 0.0000, 0.0157, 0.4471, 1.0000, 1.0000, 1.0000, 1.0000, 0.9686, 0.9765,\n", " 0.9922, 0.9843, 0.9961, 0.9294, 0.9843, 0.3490, 0.0000, 0.0000, 0.0039,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0353, 0.0000, 0.0000,\n", " 0.0039, 0.0510, 0.0000, 0.0549, 0.6549, 1.0000, 0.9647, 0.9922, 1.0000,\n", " 1.0000, 0.9961, 0.9490, 1.0000, 0.9569, 0.2392, 0.0000, 0.0745, 0.0000,\n", " 0.0039, 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0039, 0.0275, 0.0000,\n", " 0.0000, 0.0157, 0.0000, 0.0549, 0.0000, 0.1059, 0.2392, 0.5608, 1.0000,\n", " 1.0000, 0.9882, 1.0000, 0.5843, 0.0824, 0.0235, 0.0627, 0.0000, 0.0000,\n", " 0.0275, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000])\n", "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n", "['img_1', 'img_1029', 'img_1046', 'img_1047', 'img_1076', 'img_108', 'img_1091', 'img_1093', 'img_1096', 'img_110']\n" ] } ], "source": [ "# guest party\n", "! ls ../../../../examples/data/mnist_guest\n", "ds = MNISTDataset().load('../../../../examples/data/mnist_guest/')\n", "print(len(ds))\n", "print(ds[0][0]) \n", "print(ds.get_classes())\n", "print(ds.get_sample_ids()[0: 10])" ] }, { "cell_type": "code", "execution_count": 11, "id": "7376e75f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "not_labeled\n", "1309\n", "tensor([0.0118, 0.0000, 0.0000, 0.0118, 0.0275, 0.0118, 0.0000, 0.0118, 0.0000,\n", " 0.0431, 0.0000, 0.0000, 0.0118, 0.0000, 0.0000, 0.0118, 0.0314, 0.0000,\n", " 0.0000, 0.0118, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0039,\n", " 0.0196, 0.0000, 0.0471, 0.0000, 0.0627, 0.0000, 0.0000, 0.0157, 0.0000,\n", " 0.0078, 0.0314, 0.0118, 0.0000, 0.0157, 0.0314, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000, 0.0000, 0.0039,\n", " 0.0078, 0.0039, 0.0471, 0.0000, 0.0314, 0.0000, 0.0000, 0.0235, 0.0000,\n", " 0.0431, 0.0000, 0.0000, 0.0235, 0.0275, 0.0078, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0039, 0.0118, 0.0000, 0.0000, 0.0078,\n", " 0.0118, 0.0000, 0.0000, 0.0000, 0.0471, 0.0000, 0.0000, 0.0902, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0431, 0.0118, 0.0000, 0.0000, 0.0157, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0039, 0.0039, 0.0000, 0.0000,\n", " 0.0078, 0.0000, 0.0000, 0.0235, 0.0000, 0.0980, 0.1059, 0.5333, 0.5294,\n", " 0.7373, 0.3490, 0.3294, 0.0980, 0.0000, 0.0000, 0.0118, 0.0039, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0157, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0118, 0.3451, 0.9686, 0.9255, 1.0000,\n", " 0.9765, 0.9804, 0.8902, 0.9412, 0.5333, 0.1451, 0.0039, 0.0000, 0.0078,\n", " 0.0078, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000,\n", " 0.0118, 0.0000, 0.0000, 0.0157, 0.1059, 0.7569, 0.9843, 0.9922, 1.0000,\n", " 1.0000, 1.0000, 1.0000, 0.9412, 0.9961, 1.0000, 0.8353, 0.3490, 0.0000,\n", " 0.0000, 0.0549, 0.0039, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0235, 0.0000, 0.0000, 0.0706, 0.2196, 0.9647, 1.0000, 0.9922,\n", " 0.9529, 0.9843, 1.0000, 0.9608, 1.0000, 1.0000, 0.9961, 1.0000, 0.9059,\n", " 0.4667, 0.0275, 0.0000, 0.0196, 0.0000, 0.0000, 0.0000, 0.0000, 0.0157,\n", " 0.0000, 0.0000, 0.0471, 0.0510, 0.0000, 0.2549, 0.7451, 0.9647, 1.0000,\n", " 1.0000, 0.9843, 1.0000, 0.4275, 0.3451, 0.7804, 1.0000, 0.9686, 0.9804,\n", " 1.0000, 0.9176, 0.3608, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0392, 0.0039, 0.0000, 0.0000, 0.0706, 0.6392, 0.9725, 1.0000,\n", " 0.9216, 0.8471, 0.5882, 0.5020, 0.1765, 0.0235, 0.0314, 0.0863, 0.8314,\n", " 1.0000, 1.0000, 0.9882, 0.6745, 0.0000, 0.0588, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0039, 0.0157, 0.0196, 0.0000, 0.0000, 0.7333, 1.0000,\n", " 0.9961, 0.3686, 0.2235, 0.0275, 0.0039, 0.0000, 0.0235, 0.0000, 0.0000,\n", " 0.5451, 0.9490, 1.0000, 1.0000, 0.8549, 0.2431, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0196, 0.0078, 0.0000, 0.0000, 0.0431, 0.2196, 0.9882,\n", " 0.9216, 0.9922, 0.0784, 0.0196, 0.0078, 0.0196, 0.0039, 0.0000, 0.0039,\n", " 0.0078, 0.0000, 0.3804, 0.9765, 0.9725, 0.9765, 0.6510, 0.0314, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0000, 0.2745,\n", " 1.0000, 1.0000, 0.9608, 0.0980, 0.0392, 0.0000, 0.0000, 0.0039, 0.0000,\n", " 0.0157, 0.0392, 0.0000, 0.0392, 1.0000, 0.9647, 0.9804, 0.6078, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0000, 0.0275, 0.0471, 0.0000,\n", " 0.3412, 0.8863, 1.0000, 0.7216, 0.0000, 0.0118, 0.0000, 0.0392, 0.0196,\n", " 0.0000, 0.0000, 0.0000, 0.0353, 0.0000, 0.7176, 0.9843, 1.0000, 0.8706,\n", " 0.0588, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0196, 0.0039, 0.0000,\n", " 0.0745, 0.9020, 1.0000, 0.9529, 1.0000, 0.1373, 0.0078, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0353, 0.0314, 0.0000, 0.0000, 0.2745, 0.9608, 0.9490,\n", " 1.0000, 0.0549, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0157, 0.0118,\n", " 0.0000, 0.0745, 0.9843, 0.9373, 1.0000, 0.9686, 0.1176, 0.0039, 0.0000,\n", " 0.0157, 0.0157, 0.0549, 0.0000, 0.0000, 0.0078, 0.0000, 0.1843, 1.0000,\n", " 1.0000, 0.9686, 0.0824, 0.0000, 0.0000, 0.0000, 0.0000, 0.0235, 0.0000,\n", " 0.0078, 0.0078, 0.0000, 0.6784, 0.9686, 0.9882, 0.9804, 0.1098, 0.0392,\n", " 0.0000, 0.0000, 0.0314, 0.0000, 0.0000, 0.0000, 0.0314, 0.0000, 0.2627,\n", " 0.9765, 1.0000, 1.0000, 0.0471, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0235, 0.0118, 0.0000, 0.3451, 1.0000, 0.9843, 1.0000, 0.7373,\n", " 0.0824, 0.0000, 0.0588, 0.0000, 0.0314, 0.0078, 0.0627, 0.0000, 0.1373,\n", " 0.7843, 0.9686, 0.9843, 0.5255, 0.0157, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0118, 0.0118, 0.0039, 0.0000, 0.0431, 0.8275, 0.9686, 0.9765,\n", " 1.0000, 0.7412, 0.2980, 0.0000, 0.0000, 0.0157, 0.0000, 0.0078, 0.0000,\n", " 0.6627, 1.0000, 1.0000, 0.9686, 0.1843, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0235, 0.0000, 0.0000, 0.0078, 0.0000, 0.2314, 0.8039,\n", " 1.0000, 0.9412, 1.0000, 0.7137, 0.1608, 0.2196, 0.1098, 0.1294, 0.1647,\n", " 0.9373, 0.9647, 0.9843, 0.9333, 0.6157, 0.0000, 0.0039, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0078, 0.0039, 0.0000, 0.0000, 0.0078, 0.0392, 0.0000,\n", " 0.4078, 0.9373, 1.0000, 0.9412, 1.0000, 0.9922, 0.9686, 0.9294, 1.0000,\n", " 1.0000, 0.9804, 1.0000, 0.9373, 1.0000, 0.3922, 0.0000, 0.0039, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0039, 0.0000, 0.0118, 0.0000, 0.0000, 0.0275,\n", " 0.0000, 0.0157, 0.4471, 1.0000, 1.0000, 1.0000, 1.0000, 0.9686, 0.9765,\n", " 0.9922, 0.9843, 0.9961, 0.9294, 0.9843, 0.3490, 0.0000, 0.0000, 0.0039,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0353, 0.0000, 0.0000,\n", " 0.0039, 0.0510, 0.0000, 0.0549, 0.6549, 1.0000, 0.9647, 0.9922, 1.0000,\n", " 1.0000, 0.9961, 0.9490, 1.0000, 0.9569, 0.2392, 0.0000, 0.0745, 0.0000,\n", " 0.0039, 0.0000, 0.0000, 0.0000, 0.0000, 0.0078, 0.0039, 0.0275, 0.0000,\n", " 0.0000, 0.0157, 0.0000, 0.0549, 0.0000, 0.1059, 0.2392, 0.5608, 1.0000,\n", " 1.0000, 0.9882, 1.0000, 0.5843, 0.0824, 0.0235, 0.0627, 0.0000, 0.0000,\n", " 0.0275, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000,\n", " 0.0000])\n" ] } ], "source": [ "# host party\n", "! ls ../../../../examples/data/mnist_host # no label\n", "ds = MNISTDataset(return_label=False).load('../../../../examples/data/mnist_host')\n", "print(len(ds))\n", "print(ds[0]) # no label" ] }, { "cell_type": "markdown", "id": "10f67d51", "metadata": {}, "source": [ "Good! It’s ready to use, so let’s use this developed dataset to run a Hetero-NN model, and both parties use the two datasets mnist_guest & mnist_host aligned by id to conduct a hetero federated training\n", "\n", "The same as the Homo-NN(see [Customize your Dataset](Homo-NN-Customize-your-Dataset.ipynb)), here we will not follow the usage of conventional FATE components, but directly bind the data path to a FATE name&namespace and pass it to the Hetero-NN component through the reader, and Hetero-NN imports your custom dataset class through the DatasetParam you set, then read data from the path." ] }, { "cell_type": "markdown", "id": "11e272d8", "metadata": {}, "source": [ "## pipeline initialization\n", "\n", "Here we define the pipeline to run a hetero task" ] }, { "cell_type": "code", "execution_count": 21, "id": "7184ed53", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'namespace': 'experiment', 'table_name': 'mnist_host'}" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os\n", "import torch as t\n", "from torch import nn\n", "from pipeline import fate_torch_hook\n", "from pipeline.component import HeteroNN\n", "from pipeline.component.hetero_nn import DatasetParam\n", "from pipeline.backend.pipeline import PipeLine\n", "from pipeline.component import Reader, Evaluation, DataTransform\n", "from pipeline.interface import Data, Model\n", "from pipeline.component.nn import save_to_fate\n", "\n", "fate_torch_hook(t)\n", "\n", "# bind path to fate name&namespace\n", "fate_project_path = os.path.abspath('../../../../')\n", "guest = 10000\n", "host = 9999\n", "\n", "pipeline_img = PipeLine().set_initiator(role='guest', party_id=guest).set_roles(guest=guest, host=host)\n", "\n", "guest_data = {\"name\": \"mnist_guest\", \"namespace\": \"experiment\"}\n", "host_data = {\"name\": \"mnist_host\", \"namespace\": \"experiment\"}\n", "\n", "guest_data_path = fate_project_path + '/examples/data/mnist_guest/'\n", "host_data_path = fate_project_path + '/examples/data/mnist_host/'\n", "pipeline_img.bind_table(name='mnist_guest', namespace='experiment', path=guest_data_path)\n", "pipeline_img.bind_table(name='mnist_host', namespace='experiment', path=host_data_path)" ] }, { "cell_type": "code", "execution_count": 22, "id": "94f480ba", "metadata": {}, "outputs": [], "source": [ "guest_data = {\"name\": \"mnist_guest\", \"namespace\": \"experiment\"}\n", "host_data = {\"name\": \"mnist_host\", \"namespace\": \"experiment\"}\n", "reader_0 = Reader(name=\"reader_0\")\n", "reader_0.get_party_instance(role='guest', party_id=guest).component_param(table=guest_data)\n", "reader_0.get_party_instance(role='host', party_id=host).component_param(table=host_data)" ] }, { "cell_type": "code", "execution_count": 23, "id": "38f41dbe", "metadata": {}, "outputs": [], "source": [ "hetero_nn_0 = HeteroNN(name=\"hetero_nn_0\", epochs=3,\n", " interactive_layer_lr=0.01, batch_size=512, task_type='classification', seed=100\n", " )\n", "guest_nn_0 = hetero_nn_0.get_party_instance(role='guest', party_id=guest)\n", "host_nn_0 = hetero_nn_0.get_party_instance(role='host', party_id=host)\n", "\n", "# define model\n", "# image features 784, guest bottom model\n", "# our simple classification model:\n", "guest_bottom = t.nn.Sequential(\n", " t.nn.Linear(784, 8),\n", " t.nn.ReLU()\n", ")\n", "\n", "# image features 784, host bottom model\n", "host_bottom = t.nn.Sequential(\n", " t.nn.Linear(784, 8),\n", " t.nn.ReLU()\n", ")\n", "\n", "# Top Model, a classifier\n", "guest_top = t.nn.Sequential(\n", " nn.Linear(8, 10),\n", " nn.Softmax(dim=1)\n", ")\n", "\n", "# interactive layer define\n", "interactive_layer = t.nn.InteractiveLayer(out_dim=8, guest_dim=8, host_dim=8)\n", "\n", "# add models\n", "guest_nn_0.add_top_model(guest_top)\n", "guest_nn_0.add_bottom_model(guest_bottom)\n", "host_nn_0.add_bottom_model(host_bottom)\n", "\n", "# opt, loss\n", "optimizer = t.optim.Adam(lr=0.01) \n", "loss = t.nn.CrossEntropyLoss()\n", "\n", "# use DatasetParam to specify dataset and pass parameters\n", "guest_nn_0.add_dataset(DatasetParam(dataset_name='mnist_dataset', return_label=True))\n", "host_nn_0.add_dataset(DatasetParam(dataset_name='mnist_dataset', return_label=False))\n", "\n", "hetero_nn_0.set_interactive_layer(interactive_layer)\n", "hetero_nn_0.compile(optimizer=optimizer, loss=loss)" ] }, { "cell_type": "code", "execution_count": 24, "id": "cb09b949", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pipeline_img.add_component(reader_0)\n", "pipeline_img.add_component(hetero_nn_0, data=Data(train_data=reader_0.output.data))\n", "pipeline_img.add_component(Evaluation(name='eval_0', eval_type='multi'), data=Data(data=hetero_nn_0.output.data))\n", "pipeline_img.compile()" ] }, { "cell_type": "code", "execution_count": 25, "id": "0987a621", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[32m2022-12-24 17:37:26.846\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m83\u001b[0m - \u001b[1mJob id is 202212241737239009640\n", "\u001b[0m\n", "\u001b[32m2022-12-24 17:37:26.858\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m98\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KJob is still waiting, time elapse: 0:00:00\u001b[0m\n", "\u001b[0mm2022-12-24 17:37:27.906\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m125\u001b[0m - \u001b[1m\n", "\u001b[32m2022-12-24 17:37:27.908\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:01\u001b[0m\n", "\u001b[32m2022-12-24 17:37:28.931\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:02\u001b[0m\n", "\u001b[32m2022-12-24 17:37:29.954\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:03\u001b[0m\n", "\u001b[32m2022-12-24 17:37:30.982\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:04\u001b[0m\n", "\u001b[32m2022-12-24 17:37:32.045\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:05\u001b[0m\n", "\u001b[32m2022-12-24 17:37:33.096\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component reader_0, time elapse: 0:00:06\u001b[0m\n", "\u001b[0mm2022-12-24 17:37:35.464\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m125\u001b[0m - \u001b[1m\n", "\u001b[32m2022-12-24 17:37:35.465\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:08\u001b[0m\n", "\u001b[32m2022-12-24 17:37:36.528\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:09\u001b[0m\n", "\u001b[32m2022-12-24 17:37:37.565\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:10\u001b[0m\n", "\u001b[32m2022-12-24 17:37:38.595\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:11\u001b[0m\n", "\u001b[32m2022-12-24 17:37:39.631\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:12\u001b[0m\n", "\u001b[32m2022-12-24 17:37:40.660\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:13\u001b[0m\n", "\u001b[32m2022-12-24 17:37:41.689\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:14\u001b[0m\n", "\u001b[32m2022-12-24 17:37:42.735\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:15\u001b[0m\n", "\u001b[32m2022-12-24 17:37:43.763\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:16\u001b[0m\n", "\u001b[32m2022-12-24 17:37:44.843\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:17\u001b[0m\n", "\u001b[32m2022-12-24 17:37:45.868\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:19\u001b[0m\n", "\u001b[32m2022-12-24 17:37:46.898\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:20\u001b[0m\n", "\u001b[32m2022-12-24 17:37:47.923\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:21\u001b[0m\n", "\u001b[32m2022-12-24 17:37:48.948\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:22\u001b[0m\n", "\u001b[32m2022-12-24 17:37:49.977\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:23\u001b[0m\n", "\u001b[32m2022-12-24 17:37:51.022\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:24\u001b[0m\n", "\u001b[32m2022-12-24 17:37:52.046\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:25\u001b[0m\n", "\u001b[32m2022-12-24 17:37:53.069\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:26\u001b[0m\n", "\u001b[32m2022-12-24 17:37:54.110\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:27\u001b[0m\n", "\u001b[32m2022-12-24 17:37:55.145\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:28\u001b[0m\n", "\u001b[32m2022-12-24 17:37:56.177\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:29\u001b[0m\n", "\u001b[32m2022-12-24 17:37:57.216\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:30\u001b[0m\n", "\u001b[32m2022-12-24 17:37:58.258\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:31\u001b[0m\n", "\u001b[32m2022-12-24 17:37:59.289\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:32\u001b[0m\n", "\u001b[32m2022-12-24 17:38:00.315\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:33\u001b[0m\n", "\u001b[32m2022-12-24 17:38:01.336\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:34\u001b[0m\n", "\u001b[32m2022-12-24 17:38:02.384\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:35\u001b[0m\n", "\u001b[32m2022-12-24 17:38:03.411\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:36\u001b[0m\n", "\u001b[32m2022-12-24 17:38:04.433\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:37\u001b[0m\n", "\u001b[32m2022-12-24 17:38:05.455\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:38\u001b[0m\n", "\u001b[32m2022-12-24 17:38:06.475\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:39\u001b[0m\n", "\u001b[32m2022-12-24 17:38:07.494\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:40\u001b[0m\n", "\u001b[32m2022-12-24 17:38:08.513\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:41\u001b[0m\n", "\u001b[32m2022-12-24 17:38:09.532\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:42\u001b[0m\n", "\u001b[32m2022-12-24 17:38:10.557\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:43\u001b[0m\n", "\u001b[32m2022-12-24 17:38:11.579\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:44\u001b[0m\n", "\u001b[32m2022-12-24 17:38:12.615\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:45\u001b[0m\n", "\u001b[32m2022-12-24 17:38:13.662\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:46\u001b[0m\n", "\u001b[32m2022-12-24 17:38:14.698\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:47\u001b[0m\n", "\u001b[32m2022-12-24 17:38:15.718\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:48\u001b[0m\n", "\u001b[32m2022-12-24 17:38:16.809\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:49\u001b[0m\n", "\u001b[32m2022-12-24 17:38:17.833\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:50\u001b[0m\n", "\u001b[32m2022-12-24 17:38:18.857\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:52\u001b[0m\n", "\u001b[32m2022-12-24 17:38:19.896\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:53\u001b[0m\n", "\u001b[32m2022-12-24 17:38:20.934\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:54\u001b[0m\n", "\u001b[32m2022-12-24 17:38:21.995\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:55\u001b[0m\n", "\u001b[32m2022-12-24 17:38:23.025\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:56\u001b[0m\n", "\u001b[32m2022-12-24 17:38:24.056\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:57\u001b[0m\n", "\u001b[32m2022-12-24 17:38:25.080\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:58\u001b[0m\n", "\u001b[32m2022-12-24 17:38:26.104\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:00:59\u001b[0m\n", "\u001b[32m2022-12-24 17:38:27.151\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:00\u001b[0m\n", "\u001b[32m2022-12-24 17:38:28.175\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:01\u001b[0m\n", "\u001b[32m2022-12-24 17:38:29.194\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:02\u001b[0m\n", "\u001b[32m2022-12-24 17:38:30.215\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:03\u001b[0m\n", "\u001b[32m2022-12-24 17:38:31.234\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:04\u001b[0m\n", "\u001b[32m2022-12-24 17:38:32.255\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:05\u001b[0m\n", "\u001b[32m2022-12-24 17:38:33.278\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:06\u001b[0m\n", "\u001b[32m2022-12-24 17:38:34.443\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:07\u001b[0m\n", "\u001b[32m2022-12-24 17:38:35.470\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:08\u001b[0m\n", "\u001b[32m2022-12-24 17:38:36.488\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:09\u001b[0m\n", "\u001b[32m2022-12-24 17:38:37.510\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:10\u001b[0m\n", "\u001b[32m2022-12-24 17:38:38.532\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:11\u001b[0m\n", "\u001b[32m2022-12-24 17:38:39.558\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:12\u001b[0m\n", "\u001b[32m2022-12-24 17:38:40.587\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:13\u001b[0m\n", "\u001b[32m2022-12-24 17:38:41.612\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:14\u001b[0m\n", "\u001b[32m2022-12-24 17:38:42.635\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:15\u001b[0m\n", "\u001b[32m2022-12-24 17:38:43.666\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:16\u001b[0m\n", "\u001b[32m2022-12-24 17:38:44.707\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:17\u001b[0m\n", "\u001b[32m2022-12-24 17:38:45.733\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:18\u001b[0m\n", "\u001b[32m2022-12-24 17:38:46.776\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:19\u001b[0m\n", "\u001b[32m2022-12-24 17:38:47.806\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:20\u001b[0m\n", "\u001b[32m2022-12-24 17:38:48.835\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:21\u001b[0m\n", "\u001b[32m2022-12-24 17:38:49.858\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:23\u001b[0m\n", "\u001b[32m2022-12-24 17:38:50.878\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:24\u001b[0m\n", "\u001b[32m2022-12-24 17:38:52.364\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:25\u001b[0m\n", "\u001b[32m2022-12-24 17:38:53.600\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:26\u001b[0m\n", "\u001b[32m2022-12-24 17:38:54.635\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:27\u001b[0m\n", "\u001b[32m2022-12-24 17:38:55.684\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:28\u001b[0m\n", "\u001b[32m2022-12-24 17:38:56.725\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:29\u001b[0m\n", "\u001b[32m2022-12-24 17:38:57.747\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:30\u001b[0m\n", "\u001b[32m2022-12-24 17:38:58.771\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:31\u001b[0m\n", "\u001b[32m2022-12-24 17:38:59.795\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:32\u001b[0m\n", "\u001b[32m2022-12-24 17:39:00.815\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:33\u001b[0m\n", "\u001b[32m2022-12-24 17:39:01.839\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:34\u001b[0m\n", "\u001b[32m2022-12-24 17:39:02.877\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:36\u001b[0m\n", "\u001b[32m2022-12-24 17:39:03.901\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:37\u001b[0m\n", "\u001b[32m2022-12-24 17:39:04.923\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:38\u001b[0m\n", "\u001b[32m2022-12-24 17:39:05.965\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:39\u001b[0m\n", "\u001b[32m2022-12-24 17:39:07.009\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:40\u001b[0m\n", "\u001b[32m2022-12-24 17:39:08.047\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:41\u001b[0m\n", "\u001b[32m2022-12-24 17:39:09.082\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:42\u001b[0m\n", "\u001b[32m2022-12-24 17:39:10.122\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:43\u001b[0m\n", "\u001b[32m2022-12-24 17:39:11.151\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:44\u001b[0m\n", "\u001b[32m2022-12-24 17:39:12.176\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:45\u001b[0m\n", "\u001b[32m2022-12-24 17:39:13.198\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:46\u001b[0m\n", "\u001b[32m2022-12-24 17:39:14.218\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:47\u001b[0m\n", "\u001b[32m2022-12-24 17:39:15.240\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:48\u001b[0m\n", "\u001b[32m2022-12-24 17:39:16.262\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:49\u001b[0m\n", "\u001b[32m2022-12-24 17:39:17.285\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:50\u001b[0m\n", "\u001b[32m2022-12-24 17:39:18.315\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:51\u001b[0m\n", "\u001b[32m2022-12-24 17:39:19.337\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component hetero_nn_0, time elapse: 0:01:52\u001b[0m\n", "\u001b[0mm2022-12-24 17:39:21.406\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m125\u001b[0m - \u001b[1m\n", "\u001b[32m2022-12-24 17:39:21.407\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:54\u001b[0m\n", "\u001b[32m2022-12-24 17:39:22.427\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:55\u001b[0m\n", "\u001b[32m2022-12-24 17:39:23.448\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:56\u001b[0m\n", "\u001b[32m2022-12-24 17:39:24.485\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:57\u001b[0m\n", "\u001b[32m2022-12-24 17:39:25.504\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:58\u001b[0m\n", "\u001b[32m2022-12-24 17:39:26.539\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m127\u001b[0m - \u001b[1m\u001b[80D\u001b[1A\u001b[KRunning component eval_0, time elapse: 0:01:59\u001b[0m\n", "\u001b[32m2022-12-24 17:39:27.576\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m89\u001b[0m - \u001b[1mJob is success!!! Job id is 202212241737239009640\u001b[0m\n", "\u001b[32m2022-12-24 17:39:27.577\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mpipeline.utils.invoker.job_submitter\u001b[0m:\u001b[36mmonitor_job_status\u001b[0m:\u001b[36m90\u001b[0m - \u001b[1mTotal time: 0:02:00\u001b[0m\n" ] } ], "source": [ "pipeline_img.fit()" ] }, { "cell_type": "code", "execution_count": 26, "id": "08f7c75c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idlabelpredict_resultpredict_scorepredict_detailtype
0img_1080.2643284201622009{'0': 0.1221427395939827, '1': 0.0131008885800...train
1img_3470.28708773851394653{'0': 0.020947180688381195, '1': 0.10722759366...train
2img_4080.2315242737531662{'0': 0.1916944831609726, '1': 0.0062320181168...train
3img_5080.2495078295469284{'0': 0.04027773439884186, '1': 0.039246417582...train
4img_6770.5058534145355225{'0': 0.011092708446085453, '1': 0.06033106520...train
.....................
1304img_32537170.228757843375206{'0': 0.02710532397031784, '1': 0.178657308220...train
1305img_32558170.22664928436279297{'0': 0.03342469036579132, '1': 0.192812800407...train
1306img_32563170.2404891550540924{'0': 0.02606056071817875, '1': 0.177977174520...train
1307img_32565170.44030535221099854{'0': 0.014257671311497688, '1': 0.11480070650...train
1308img_32573110.24856531620025635{'0': 0.028993327170610428, '1': 0.24856531620...train
\n", "

1309 rows × 6 columns

\n", "
" ], "text/plain": [ " id label predict_result predict_score \\\n", "0 img_1 0 8 0.2643284201622009 \n", "1 img_3 4 7 0.28708773851394653 \n", "2 img_4 0 8 0.2315242737531662 \n", "3 img_5 0 8 0.2495078295469284 \n", "4 img_6 7 7 0.5058534145355225 \n", "... ... ... ... ... \n", "1304 img_32537 1 7 0.228757843375206 \n", "1305 img_32558 1 7 0.22664928436279297 \n", "1306 img_32563 1 7 0.2404891550540924 \n", "1307 img_32565 1 7 0.44030535221099854 \n", "1308 img_32573 1 1 0.24856531620025635 \n", "\n", " predict_detail type \n", "0 {'0': 0.1221427395939827, '1': 0.0131008885800... train \n", "1 {'0': 0.020947180688381195, '1': 0.10722759366... train \n", "2 {'0': 0.1916944831609726, '1': 0.0062320181168... train \n", "3 {'0': 0.04027773439884186, '1': 0.039246417582... train \n", "4 {'0': 0.011092708446085453, '1': 0.06033106520... train \n", "... ... ... \n", "1304 {'0': 0.02710532397031784, '1': 0.178657308220... train \n", "1305 {'0': 0.03342469036579132, '1': 0.192812800407... train \n", "1306 {'0': 0.02606056071817875, '1': 0.177977174520... train \n", "1307 {'0': 0.014257671311497688, '1': 0.11480070650... train \n", "1308 {'0': 0.028993327170610428, '1': 0.24856531620... train \n", "\n", "[1309 rows x 6 columns]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pipeline_img.get_component('hetero_nn_0').get_output_data() # get result" ] }, { "cell_type": "code", "execution_count": null, "id": "a21f0748", "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.8.13 (default, Mar 28 2022, 11:38:47) \n[GCC 7.5.0]" }, "vscode": { "interpreter": { "hash": "d29574a2ab71ec988cdcd4d29c58400bd2037cad632b9528d973466f7fb6f853" } } }, "nbformat": 4, "nbformat_minor": 5 }