{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## **Section 1** Problem Description <a class=\"anchor\" id=\"Section 1\"></a>\n   - **Notation**</br> \n   <div class=\"alert alert-info\">\n   <b>Important:</b> i would like to take this challenge and apply other solution.\n    keep in mind this competetion is ended <strong>3 years ago</strong> only i will explore this challenge by other methods computer vision Task <strong> Vote to my solution if it was useful in your work</strong>\n   </div>\n   - **Problem Description:**</br> \n      the problem is by givne the image we will need to predict the Bounding bounding box of Cardiac in Penuomian diseases \n   \n  - **Task Split to handle this Problem:**\n      - Per-Processing :\n          * resize the images to reduce the compute weights \n          * convert the input data into .npy format for easy loading the DataLoader \n          * exploer some few images virtualization \n          * Store the Label ( X , Y , WIDTH , HEIGHT ) to predict Bounding Box \n      - Building Model :  \n          * we will use the Built in model from TorchVision **Resnet152**\n          * Fine-Tuning the model \n          * Creating Loop Training \n          * Evaluate the model \n         ","metadata":{}},{"cell_type":"code","source":"%%capture\n!pip install imgaug\n!pip install ipywidgets\n!jupyter nbextension enable --py widgetsnbextension\n!jupyter nbextension install --py --user witwidget\n!jupyter nbextension enable witwidget --user --py\n!jupyter labextension install @jupyter-widgets/jupyterlab-manager \n!jupyter labextension list","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:00:23.950229Z","iopub.execute_input":"2022-11-28T17:00:23.951022Z","iopub.status.idle":"2022-11-28T17:06:19.774573Z","shell.execute_reply.started":"2022-11-28T17:00:23.950926Z","shell.execute_reply":"2022-11-28T17:06:19.773281Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#### Import Packges \n%matplotlib widget\nimport matplotlib.pyplot as plt \nfrom pathlib import Path\nimport matplotlib.patches as patch\nfrom tqdm.notebook import tqdm \nimport numpy as np \nimport cv2\nimport pydicom as dc \nimport pandas as pd \nimport os\nimport imgaug\nimport random\nfrom imgaug import augmenters as iaa\nfrom imgaug.augmentables.bbs import BoundingBox\nfrom torchvision.utils import draw_bounding_boxes\n\n\nimport torch \nfrom torch.utils.data import Dataset , DataLoader\nimport torchvision\nimport pytorch_lightning as pl\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.loggers import TensorBoardLogger\nfrom pytorch_lightning.plugins import DDPPlugin\n\n#from pytorch_lightning.plugins.training_type.ddp import DDPPlugin\nimport warnings \ndef fxn():\n    warnings.warn(\"deprecated\", DeprecationWarning)\n\nwith warnings.catch_warnings():\n    warnings.simplefilter(\"ignore\")","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-11-28T19:01:47.744047Z","iopub.execute_input":"2022-11-28T19:01:47.744515Z","iopub.status.idle":"2022-11-28T19:01:47.763708Z","shell.execute_reply.started":"2022-11-28T19:01:47.744468Z","shell.execute_reply":"2022-11-28T19:01:47.762385Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## **Per-Processing :** <a class=\"anchor\" id=\"Per-Processing\"></a>\n  - **Per-Processing Tasks** :\n      * resize the images to reduce the compute weights \n      * convert the input data into .npy format for easy loading the DataLoader \n      * exploer some few images virtualization \n      * Store the Label ( X , Y , WIDTH , HEIGHT ) to predict Bounding Box ","metadata":{}},{"cell_type":"code","source":"### set the path \nPath_label = \"../input/rsna-pneumonia-detection-challenge/stage_2_train_labels.csv\"\nPath_img =  \"../input/rsna-pneumonia-detection-challenge/stage_2_train_images\"","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:07:30.251827Z","iopub.execute_input":"2022-11-28T17:07:30.252815Z","iopub.status.idle":"2022-11-28T17:07:30.257798Z","shell.execute_reply.started":"2022-11-28T17:07:30.252775Z","shell.execute_reply":"2022-11-28T17:07:30.256586Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#### Read data CSV file labels \nlabel = pd.read_csv(Path_label).fillna(0) ### here to replace (Nan) with zeros\nx_min = label[\"x\"].iloc[0].item()                \nprint(x_min)\nlabel.head(5)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:07:31.376022Z","iopub.execute_input":"2022-11-28T17:07:31.376659Z","iopub.status.idle":"2022-11-28T17:07:31.496537Z","shell.execute_reply.started":"2022-11-28T17:07:31.376609Z","shell.execute_reply":"2022-11-28T17:07:31.495478Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"### Virtualize few samples from the data\nfig , axis = plt.subplots(2,2,figsize=(6,6))\ncounter_img = 4 ### index to image has (x ,y) > 0 \nfor row in range(2):\n    for cols in range(2):\n        ## get image path \n        Image_Id = label.patientId.iloc[counter_img]\n        Path_full_img = os.path.join(Path_img,Image_Id) + \".dcm\" ## file extenstion \n        read_img = dc.read_file(Path_full_img).pixel_array\n        ### get the corrdinates to drwan retengcel \n        x = label.x.iloc[counter_img]\n        y = label.y.iloc[counter_img]\n        Width = label.width.iloc[counter_img]\n        Height= label.height.iloc[counter_img]\n        axis[row][cols].imshow(read_img,cmap=\"gray\")\n        rectengel = patch.Rectangle((x,y),Width,Height,linewidth=1,edgecolor=\"r\",facecolor='none')\n        axis[row][cols].add_patch(rectengel)\n        counter_img +=1","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:07:46.988185Z","iopub.execute_input":"2022-11-28T17:07:46.988658Z","iopub.status.idle":"2022-11-28T17:07:47.245696Z","shell.execute_reply.started":"2022-11-28T17:07:46.988606Z","shell.execute_reply":"2022-11-28T17:07:47.244543Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#### explore few samples from the data \n\"\"\"\n- we will read all the files dicom and store them in npy foramt for easy loading the in DataFolder Class\n- resize the images into 128x128 to handke by the RAM \n- split the data in to train and val \n- compute mean and STD \n\"\"\"\nsums , sums_square = 0,0 \nnormalizer = 128*128 \nindex_img = 0\ntrain_id =[] ###check the numbr samples in train and val \nval_id = []\nSave_path = \"./Processed_img\"\nfor index_img in tqdm(range(len(label.patientId))):\n    ### get the path image \n    patientId = label.patientId.iloc[index_img]\n    full_path_img = os.path.join(Path_img,patientId) + \".dcm\"\n    ### read the image Pixel_array and resize \n    Image = dc.read_file(full_path_img).pixel_array\n    resize_img = (cv2.resize(Image,(128,128)) / 255).astype(np.float32)\n    ### Splite the data train 24000 and val 6300\n    train_or_val = \"train\" if index_img < 24000 else \"val\"\n    ### create the folder Val and train \n    if train_or_val ==\"train\":\n        train_id.append(patientId)\n    else:\n        val_id.append(patientId)\n   ### save the array images into the folder \n    Save_path_img = Path( Save_path + \"/\" + train_or_val)\n    Save_path_img.mkdir(parents=True,exist_ok=True)\n    np.save(os.path.join(Save_path_img,patientId),resize_img)\n    ### compute mean and std after \n    if train_or_val == \"train\":\n        sums += np.sum(resize_img) / normalizer\n        sums_square += (resize_img **2).sum() / normalizer","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:07:58.039072Z","iopub.execute_input":"2022-11-28T17:07:58.039490Z","iopub.status.idle":"2022-11-28T17:16:49.220571Z","shell.execute_reply.started":"2022-11-28T17:07:58.039448Z","shell.execute_reply":"2022-11-28T17:16:49.219379Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#### save the trainng and validation samples Path \nnp.save(\"Processed-Heart-detetection-train\",train_id)\nnp.save(\"Processed-Heart-detetection-val\",val_id)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:16:51.708742Z","iopub.execute_input":"2022-11-28T17:16:51.709113Z","iopub.status.idle":"2022-11-28T17:16:51.725530Z","shell.execute_reply.started":"2022-11-28T17:16:51.709080Z","shell.execute_reply":"2022-11-28T17:16:51.724538Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"load_train = np.load(\"./Processed-Heart-detetection-train.npy\")\nload_train[:2]","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:16:54.016840Z","iopub.execute_input":"2022-11-28T17:16:54.017201Z","iopub.status.idle":"2022-11-28T17:16:54.028451Z","shell.execute_reply.started":"2022-11-28T17:16:54.017169Z","shell.execute_reply":"2022-11-28T17:16:54.027483Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"## compute mean nd STD to use them in augmentation setp\nmean = sums / len(train_id)\nstd = np.sqrt((sums_square / len(train_id)) - mean**2)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:16:59.470173Z","iopub.execute_input":"2022-11-28T17:16:59.471174Z","iopub.status.idle":"2022-11-28T17:16:59.477921Z","shell.execute_reply.started":"2022-11-28T17:16:59.471132Z","shell.execute_reply":"2022-11-28T17:16:59.476749Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mean , std","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:17:01.004754Z","iopub.execute_input":"2022-11-28T17:17:01.005150Z","iopub.status.idle":"2022-11-28T17:17:01.012790Z","shell.execute_reply.started":"2022-11-28T17:17:01.005118Z","shell.execute_reply":"2022-11-28T17:17:01.011785Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## **Loading data and augmenetation :** <a class=\"anchor\" id=\"Loading data and augmenetation\"></a>\n  - **Loading data and augmenetation Tasks** :\n      * creat class Cardiac from torch Datasets functional helpers\n      * augemente Bounding Box and Images\n      \n","metadata":{}},{"cell_type":"code","source":"### creat Class Dataset \nclass Cradiac_(Dataset):\n    def __init__(self, path_label_csv , path_patientId , Root_path_Image , transform=None):\n        self.path_label = pd.read_csv(path_label_csv).fillna(0)\n        self.patientId = np.load(path_patientId)\n        self.root_path = Root_path_Image\n        self.transform = transform\n        \n    ### here we will need to return lenght of images \n    def __len__(self):\n        return len(self.patientId)\n    ### getItem by index to label image \n    def __getitem__(self,idx):\n        ###check the image ID match with with label \n        patient_Id = self.patientId[idx]\n        label_ = self.path_label[self.path_label[\"patientId\"] == patient_Id]\n        ### extract the corrdinates label and getItem value isung Item()\n        x_min = self.path_label[\"x\"].iloc[idx].item()\n        y_min = self.path_label[\"y\"].iloc[idx].item()\n        x_max = x_min + self.path_label[\"width\"].iloc[idx].item()\n        y_max = y_min + self.path_label[\"height\"].iloc[idx].item()\n        Boxes = [x_min,y_min,x_max,y_max]\n        ### get the image path to apply augemnetation step \n        image_path = os.path.join(self.root_path,patient_Id) + '.npy'\n        load_img = np.load(image_path).astype(np.float32) \n        ### augment Bounding Box \n        if self.transform:\n            Bounding_label = BoundingBox(x1=Boxes[0] , y1=Boxes[1], x2=Boxes[2] ,y2=Boxes[3] , label=None)\n            img , BoundingBoxs = self.transform(load_img,Bounding_label)\n            #### BoundingBoxes is tuple (x,y,x1,y1) of tow demission we need to index \n            corrdinates_boxes = BoundingBoxs[0][0], BoundingBoxs[0][1], BoundingBoxs[1][0], BoundingBoxs[1][1]\n        \n            #### load the image_ and BoundingBoxes to tensos \n            image_out= (img - 0.489) / 0.246\n            image_out_ = torch.tensor(image_out).unsqueeze(0)\n            box = torch.tensor(corrdinates_boxes)\n            \n            return image_out_ , box ","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:20:24.849248Z","iopub.execute_input":"2022-11-28T17:20:24.849991Z","iopub.status.idle":"2022-11-28T17:20:24.862517Z","shell.execute_reply.started":"2022-11-28T17:20:24.849952Z","shell.execute_reply":"2022-11-28T17:20:24.861468Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"###  make class Augementation with list probs \nclass Sequence_Aug(object):\n    def __init__(self,Augmentation_commands, Proba=0.5):\n        self.augmentation = Augmentation_commands #### this is list of augmentes instruction \n        self.probs = Proba ### this Var is for storing Probabilty values \n    def __call__(self, load_img , Bounding_label ):\n        for i , tranform_aug in enumerate(self.augmentation):\n            if type(self.probs) == list:\n                prob_ = self.probs[i]\n            else:\n                prob_ = self.probs\n            if  prob_ < 1 : # here chekc if the random proba avereg between [1-0]\n                ## set the random Seed \n                image_ , boxes_ = tranform_aug(images=load_img ,bounding_boxes = Bounding_label )\n        return  image_ , boxes_ ","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:20:28.232095Z","iopub.execute_input":"2022-11-28T17:20:28.232519Z","iopub.status.idle":"2022-11-28T17:20:28.240132Z","shell.execute_reply.started":"2022-11-28T17:20:28.232484Z","shell.execute_reply":"2022-11-28T17:20:28.238988Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"augmentation_list = [iaa.GammaContrast(),\n                     iaa.Affine(scale=(0.8,1.2),\n                                rotate=(-10.10),\n                                translate_px=(-10,10))]\ntransforms = Sequence_Aug(augmentation_list,0.5)\n","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:20:33.736686Z","iopub.execute_input":"2022-11-28T17:20:33.737061Z","iopub.status.idle":"2022-11-28T17:20:33.742719Z","shell.execute_reply.started":"2022-11-28T17:20:33.737030Z","shell.execute_reply":"2022-11-28T17:20:33.741564Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"patient_id = './Processed-Heart-detetection-train.npy'\npath_img_proccsed = \"./Processed_img/train\"\ndataset = Cradiac_(Path_label,patient_id,path_img_proccsed,transform=transforms)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:20:35.233959Z","iopub.execute_input":"2022-11-28T17:20:35.234354Z","iopub.status.idle":"2022-11-28T17:20:35.273661Z","shell.execute_reply.started":"2022-11-28T17:20:35.234314Z","shell.execute_reply":"2022-11-28T17:20:35.272529Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"img_pro, box = dataset[0]\n\n### plot img \nfig , axis = plt.subplots(1,1,figsize=(5,5))\naxis.imshow(img_pro[0],cmap=\"gray\")\nrectengel = patch.Rectangle((box[0],box[1]),box[2],box[3],linewidth=2,edgecolor=\"r\",facecolor='none')\naxis.add_patch(rectengel)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:20:46.184612Z","iopub.execute_input":"2022-11-28T17:20:46.185081Z","iopub.status.idle":"2022-11-28T17:20:46.244949Z","shell.execute_reply.started":"2022-11-28T17:20:46.185041Z","shell.execute_reply":"2022-11-28T17:20:46.243890Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## **Traning and building the model** <a class=\"anchor\" id=\"Traning and building\"></a>\n   * **Step work pipline Pytorch lighiting** \n        - Loading the data from Cracdiac_ calss costume data Obejct\n        - set the Hyper-parameters of DataLoader      \n        - **Pipline model** Building model <a class=\"anchor\" id=\"Section3\"></a>\n            - by calling this API torchvision \n              * torchvision.models.resnet152()\n                * change the number of channel Conv1 from 3 to 1\n                   * **(conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)**\n                * change the output of last layer fully connected layer to 4 ==>  [x_min,y_min,x_max,y_max]\n                   * **(fc): Linear(in_features=2048, out_features=1000, bias=True)**\n                - **Notation** :  <div class=\"alert alert-info\">since the competition is ended 3 years ago here i just tried give a briefy implementation of<strong> Pytorch **Lighiting**</strong></div> <br>\n                - **that's why we will just run the Model on 10 Epochs and you can raise it to wished value if you would like**\n\n","metadata":{}},{"cell_type":"code","source":"### the set necesseray Path \nPath_training = \"./Processed_img/train\"\nPath_validation = './Processed_img/val'\nPath_label_csv_file = \"../input/rsna-pneumonia-detection-challenge/stage_2_train_labels.csv\"\nPatient_Id_train = \"./Processed-Heart-detetection-train.npy\"\nPatient_Id_val = \"./Processed-Heart-detetection-val.npy\"","metadata":{"execution":{"iopub.status.busy":"2022-11-28T17:21:00.608210Z","iopub.execute_input":"2022-11-28T17:21:00.608825Z","iopub.status.idle":"2022-11-28T17:21:00.614795Z","shell.execute_reply.started":"2022-11-28T17:21:00.608789Z","shell.execute_reply":"2022-11-28T17:21:00.612967Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"### set the parameters Augmenration in list  and DataLoader parameters \naugmentation_ = [iaa.GammaContrast(),\n                     iaa.Affine(scale=(0.8,1.2),\n                                rotate=(-5.5),\n                                translate_px=(-5,5))]\nTransforms = Sequence_Aug(augmentation_,0.6)\nbatch_size = 64\nnum_workers = 2 \n### loading thr dataset from Costume Class \nData_traning = Cradiac_(Path_label_csv_file,Patient_Id_train,Path_training,transform=Transforms)\ntraning_set=DataLoader(Data_traning,batch_size = batch_size ,num_workers=num_workers,shuffle=True)\nData_validation  = Cradiac_(Path_label_csv_file,Patient_Id_val,Path_validation,transform=None)\nvalidation_set = DataLoader(Data_traning,batch_size = batch_size ,num_workers=num_workers,shuffle=False)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T18:47:46.133224Z","iopub.execute_input":"2022-11-28T18:47:46.134349Z","iopub.status.idle":"2022-11-28T18:47:46.211843Z","shell.execute_reply.started":"2022-11-28T18:47:46.134276Z","shell.execute_reply":"2022-11-28T18:47:46.210851Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf","metadata":{"execution":{"iopub.status.busy":"2022-11-28T19:10:37.748825Z","iopub.execute_input":"2022-11-28T19:10:37.749232Z","iopub.status.idle":"2022-11-28T19:10:37.753567Z","shell.execute_reply.started":"2022-11-28T19:10:37.749198Z","shell.execute_reply":"2022-11-28T19:10:37.752585Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"### Building Models \n###### Creating the model \nclass Detector_Cradiac(pl.LightningModule):\n    def __init__(self):\n        super().__init__()\n        ### the PL of model \n        self.model = torchvision.models.resnet18()\n        self.model.conv1 = torch.nn.Conv2d(1, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)\n        self.model.fc = torch.nn.Linear(in_features=512, out_features=4)\n        ### setup the Optimizer and loss functions \n        self.Optimizer = torch.optim.Adam(self.model.parameters(),lr = 1e-4)\n        self.Loss_F = torch.nn.MSELoss()\n         # simple accuracy computation\n#         self.train_acc = torchmetrics.Accuracy()\n#         self.val_acc = torchmetrics.Accuracy()\n        \n    def forward(self, input_):\n        Predicted_label = self.model(input_)\n        return Predicted_label\n        \n    def training_step(self,batch , batch_idx):\n        Image , label = batch \n        label = label.float()\n        Predicted_label = self(Image)\n        loss = self.Loss_F(Predicted_label,label)\n        \n        self.log(\"Train loss\",loss)\n            \n        return loss\n    \n   \n    #######\n    ### here we did the same as Traiing PL we changed only the input_data disttro\n    #######\n    def validation_step(self,batch , batch_idx):\n        Image , label = batch \n        label = label.float()\n        Predicted_label = self(Image)\n        loss = self.Loss_F(Predicted_label,label)\n        \n        self.log(\"Val loss\",loss)\n            \n        return loss,\n    \n    def configure_optimizers(self):\n        #Caution! You always need to return a list here (just pack your optimizer into one :))\n        return [self.Optimizer]     ","metadata":{"execution":{"iopub.status.busy":"2022-11-28T19:17:56.499052Z","iopub.execute_input":"2022-11-28T19:17:56.499500Z","iopub.status.idle":"2022-11-28T19:17:56.511592Z","shell.execute_reply.started":"2022-11-28T19:17:56.499454Z","shell.execute_reply":"2022-11-28T19:17:56.510258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Model_ = Detector_Cradiac() ### instanace the model from the class \nCheck_Point_Callbacks = ModelCheckpoint(\n    monitor=\"Val loss\", \n    save_top_k=12,\n    mode=\"min\")\n","metadata":{"execution":{"iopub.status.busy":"2022-11-28T19:18:00.947139Z","iopub.execute_input":"2022-11-28T19:18:00.947928Z","iopub.status.idle":"2022-11-28T19:18:01.148117Z","shell.execute_reply.started":"2022-11-28T19:18:00.947888Z","shell.execute_reply":"2022-11-28T19:18:01.147074Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Create the trainer\n# Change the gpus parameter to the number of available gpus on your system. Use 0 for CPU training\n\ngpus = 2 #TODO\nTrainer = pl.Trainer(accelerator='gpu', devices=2, logger=TensorBoardLogger(save_dir= \"./processed/logs_weights_ex3\"), log_every_n_steps=1,\n                     callbacks=Check_Point_Callbacks,                    \n                     max_epochs=10)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T19:16:08.916351Z","iopub.execute_input":"2022-11-28T19:16:08.918166Z","iopub.status.idle":"2022-11-28T19:16:09.886809Z","shell.execute_reply.started":"2022-11-28T19:16:08.918120Z","shell.execute_reply":"2022-11-28T19:16:09.885408Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Trainer.fit(Model_,traning_set,validation_set)","metadata":{"execution":{"iopub.status.busy":"2022-11-28T19:18:03.203721Z","iopub.execute_input":"2022-11-28T19:18:03.204996Z","iopub.status.idle":"2022-11-28T19:55:30.058564Z","shell.execute_reply.started":"2022-11-28T19:18:03.204935Z","shell.execute_reply":"2022-11-28T19:55:30.057038Z"},"trusted":true},"execution_count":null,"outputs":[]}]}