520 lines
36 KiB
Text
Executable file
520 lines
36 KiB
Text
Executable file
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"#Tous les codes sont basés sur l'environnement suivant\n",
|
||
"#python 3.7\n",
|
||
"#opencv 3.1.0\n",
|
||
"#pytorch 1.4.0\n",
|
||
"\n",
|
||
"import torch\n",
|
||
"from torch.autograd import Variable\n",
|
||
"import torch.nn as nn\n",
|
||
"import torch.nn.functional as F\n",
|
||
"import cv2\n",
|
||
"import matplotlib.pyplot as plt\n",
|
||
"import numpy as np\n",
|
||
"import random\n",
|
||
"import math\n",
|
||
"import pickle\n",
|
||
"import random\n",
|
||
"from PIL import Image\n",
|
||
"import sys"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"#Les fonctions dans ce bloc ne sont pas utilisées par le réseau, mais certaines fonctions d'outils\n",
|
||
"\n",
|
||
"\n",
|
||
"def tensor_imshow(im_tensor,cannel):\n",
|
||
" b,c,h,w=im_tensor.shape\n",
|
||
" if c==1:\n",
|
||
" plt.imshow(im_tensor.squeeze().detach().numpy())\n",
|
||
" else:\n",
|
||
" plt.imshow(im_tensor.squeeze().detach().numpy()[cannel,:])\n",
|
||
"\n",
|
||
"# Obtenez des données d'entraînement\n",
|
||
"# frag,vt=get_training_fragment(frag_size,image)\n",
|
||
"# frag est un patch carrée de taille (frag_size*frag_size) a partir du image(Son emplacement est aléatoire)\n",
|
||
"# vt est la vérité terrain de la forme Dirac.\n",
|
||
"def get_training_fragment(frag_size,im):\n",
|
||
" h,w,c=im.shape\n",
|
||
" n=random.randint(0,int(h/frag_size)-1)\n",
|
||
" m=random.randint(0,int(w/frag_size)-1) \n",
|
||
" shape=frag_size/4\n",
|
||
" vt_h=math.ceil((h+1)/shape)\n",
|
||
" vt_w=math.ceil((w+1)/shape)\n",
|
||
" vt=np.zeros([vt_h,vt_w])\n",
|
||
" vt_h_po=round((vt_h-1)*(n*frag_size/(h-1)+(n+1)*frag_size/(h-1))/2)\n",
|
||
" vt_w_po=round((vt_w-1)*(m*frag_size/(w-1)+(m+1)*frag_size/(w-1))/2)\n",
|
||
" vt[vt_h_po,vt_w_po]=1\n",
|
||
" vt = np.float32(vt)\n",
|
||
" vt=torch.from_numpy(vt.reshape(1,1,vt_h,vt_w))\n",
|
||
" \n",
|
||
" return im[n*frag_size:(n+1)*frag_size,m*frag_size:(m+1)*frag_size,:],vt\n",
|
||
"\n",
|
||
"# Charger un fragment d'entrainement\n",
|
||
"# Les fragments sont chargés comme des images et les véritées terrain sont générées\n",
|
||
"def load_training_fragment(frag_path,vt_path,using_cuda):\n",
|
||
" frag=cv2.imread(im_path)\n",
|
||
" with open(vt_path, 'r') as f:\n",
|
||
" data_vt = f.readlines()\n",
|
||
" \n",
|
||
" if using_cuda:\n",
|
||
" frag=frag.cuda()\n",
|
||
" vt=vt.cuda()\n",
|
||
" \n",
|
||
"\n",
|
||
"# Cette fonction convertit l'image en variable de type Tensor.\n",
|
||
"# Toutes les données de calcul du réseau sont de type Tensor\n",
|
||
"# Img.shape=[Height,Width,Channel]\n",
|
||
"# Tensor.shape=[Batch,Channel,Height,Width]\n",
|
||
"def img2tensor(im):\n",
|
||
" im=np.array(im,dtype=\"float32\")\n",
|
||
" tensor_cv = torch.from_numpy(np.transpose(im, (2, 0, 1)))\n",
|
||
" im_tensor=tensor_cv.unsqueeze(0)\n",
|
||
" return im_tensor\n",
|
||
"\n",
|
||
"# Trouvez les coordonnées de la valeur maximale dans une carte de corrélation\n",
|
||
"# x,y=show_coordonnee(carte de corrélation)\n",
|
||
"def show_coordonnee(position_pred):\n",
|
||
" map_corre=position_pred.squeeze().detach().numpy()\n",
|
||
" h,w=map_corre.shape\n",
|
||
" max_value=map_corre.max()\n",
|
||
" coordonnee=np.where(map_corre==max_value)\n",
|
||
" return coordonnee[0].mean()/h,coordonnee[1].mean()/w\n",
|
||
"\n",
|
||
"# Filtrer les patchs en fonction du nombre de pixels noirs dans le patch\n",
|
||
"# Si seuls les pixels non noirs sont plus grands qu'une certaine proportion(seuillage), revenez à True, sinon False\n",
|
||
"def test_fragment32_32(frag,seuillage):\n",
|
||
" a=frag[:,:,0]+frag[:,:,1]+frag[:,:,2]\n",
|
||
" mask = (a == 0)\n",
|
||
" arr_new = a[mask]\n",
|
||
" if arr_new.size/a.size<=(1-seuillage):\n",
|
||
" return True\n",
|
||
" else:\n",
|
||
" return False\n",
|
||
" \n",
|
||
"# Ces deux fonctions permettent de sauvegarder le réseau dans un fichier\n",
|
||
"# ou de load le réseau stocké à partir d'un fichier\n",
|
||
"def save_net(file_path,net):\n",
|
||
" pkl_file = open(file_path, 'wb')\n",
|
||
" pickle.dump(net,pkl_file)\n",
|
||
" pkl_file.close()\n",
|
||
"def load_net(file_path): \n",
|
||
" pkl_file = open(file_path, 'rb')\n",
|
||
" net= pickle.load(pkl_file)\n",
|
||
" pkl_file.close()\n",
|
||
" return net"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 6,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"# Créer un poids de type DeepMatch comme valeur initiale de Conv1 (non obligatoire)\n",
|
||
"def ini():\n",
|
||
" kernel=torch.zeros([8,3,3,3])\n",
|
||
" array_0=np.array([[1,2,1],[0,0,0],[-1,-2,-1]],dtype='float32')\n",
|
||
" array_1=np.array([[2,1,0],[1,0,-1],[0,-1,-2]],dtype='float32')\n",
|
||
" array_2=np.array([[1,0,-1],[2,0,-2],[1,0,-1]],dtype='float32')\n",
|
||
" array_3=np.array([[0,-1,-2],[1,0,-1],[2,1,0]],dtype='float32')\n",
|
||
" array_4=np.array([[-1,-2,-1],[0,0,0],[1,2,1]],dtype='float32')\n",
|
||
" array_5=np.array([[-2,-1,0],[-1,0,1],[0,1,2]],dtype='float32')\n",
|
||
" array_6=np.array([[-1,0,1],[-2,0,2],[-1,0,1]],dtype='float32')\n",
|
||
" array_7=np.array([[0,1,2],[-1,0,1],[-2,-1,0]],dtype='float32')\n",
|
||
" for i in range(3):\n",
|
||
" kernel[0,i,:]=torch.from_numpy(array_0)\n",
|
||
" kernel[1,i,:]=torch.from_numpy(array_1)\n",
|
||
" kernel[2,i,:]=torch.from_numpy(array_2)\n",
|
||
" kernel[3,i,:]=torch.from_numpy(array_3)\n",
|
||
" kernel[4,i,:]=torch.from_numpy(array_4)\n",
|
||
" kernel[5,i,:]=torch.from_numpy(array_5)\n",
|
||
" kernel[6,i,:]=torch.from_numpy(array_6)\n",
|
||
" kernel[7,i,:]=torch.from_numpy(array_7)\n",
|
||
" return torch.nn.Parameter(kernel,requires_grad=True) \n",
|
||
"\n",
|
||
"# Calculer le poids initial de la couche convolutive add\n",
|
||
"# n, m signifie qu'il y a n * m sous-patches dans le patch d'entrée\n",
|
||
"# Par exemple, le patch d'entrée est 16 * 16, pour les patchs 4 * 4 de la première couche, n = 4, m = 4\n",
|
||
"# pour les patchs 8 * 8 de la deuxième couche, n = 2, m = 2\n",
|
||
"def kernel_add_ini(n,m):\n",
|
||
" input_canal=int(n*m)\n",
|
||
" output_canal=int(n/2)*int(m/2)\n",
|
||
" for i in range(int(n/2)):\n",
|
||
" for j in range(int(m/2)):\n",
|
||
" kernel_add=np.zeros([1,input_canal],dtype='float32')\n",
|
||
" kernel_add[0,i*2*m+j*2]=1\n",
|
||
" kernel_add[0,i*2*m+j*2+1]=1\n",
|
||
" kernel_add[0,(i*2+1)*m+j*2]=1\n",
|
||
" kernel_add[0,(i*2+1)*m+j*2+1]=1\n",
|
||
" if i==0 and j==0:\n",
|
||
" add=torch.from_numpy(kernel_add.reshape(1,input_canal,1,1))\n",
|
||
" else:\n",
|
||
" add_=torch.from_numpy(kernel_add.reshape(1,input_canal,1,1))\n",
|
||
" add=torch.cat((add,add_),0)\n",
|
||
" return torch.nn.Parameter(add,requires_grad=False) \n",
|
||
"\n",
|
||
"# Calculer le poids initial de la couche convolutive shift\n",
|
||
"# shift+add Peut réaliser l'étape de l'agrégation\n",
|
||
"# Voir ci-dessus pour les paramètres n et m. \n",
|
||
"# Pour des étapes plus détaillées, veuillez consulter mon rapport de stage\n",
|
||
"def kernel_shift_ini(n,m):\n",
|
||
" input_canal=int(n*m)\n",
|
||
" output_canal=int(n*m)\n",
|
||
" \n",
|
||
" kernel_shift=torch.zeros([output_canal,input_canal,3,3])\n",
|
||
" \n",
|
||
" array_0=np.array([[1,0,0],[0,0,0],[0,0,0]],dtype='float32')\n",
|
||
" array_1=np.array([[0,0,1],[0,0,0],[0,0,0]],dtype='float32')\n",
|
||
" array_2=np.array([[0,0,0],[0,0,0],[1,0,0]],dtype='float32')\n",
|
||
" array_3=np.array([[0,0,0],[0,0,0],[0,0,1]],dtype='float32')\n",
|
||
" \n",
|
||
" kernel_shift_0=torch.from_numpy(array_0)\n",
|
||
" kernel_shift_1=torch.from_numpy(array_1)\n",
|
||
" kernel_shift_2=torch.from_numpy(array_2)\n",
|
||
" kernel_shift_3=torch.from_numpy(array_3)\n",
|
||
" \n",
|
||
" \n",
|
||
" for i in range(n):\n",
|
||
" for j in range(m):\n",
|
||
" if i==0 and j==0:\n",
|
||
" kernel_shift[0,0,:]=kernel_shift_0\n",
|
||
" else:\n",
|
||
" if i%2==0 and j%2==0:\n",
|
||
" kernel_shift[i*m+j,i*m+j,:]=kernel_shift_0\n",
|
||
" if i%2==0 and j%2==1:\n",
|
||
" kernel_shift[i*m+j,i*m+j,:]=kernel_shift_1\n",
|
||
" if i%2==1 and j%2==0:\n",
|
||
" kernel_shift[i*m+j,i*m+j,:]=kernel_shift_2\n",
|
||
" if i%2==1 and j%2==1:\n",
|
||
" kernel_shift[i*m+j,i*m+j,:]=kernel_shift_3\n",
|
||
" \n",
|
||
" return torch.nn.Parameter(kernel_shift,requires_grad=False) \n",
|
||
"\n",
|
||
"# Trouvez le petit patch(4 * 4) dans la n ème ligne et la m ème colonne du patch d'entrée\n",
|
||
"# Ceci est utilisé pour calculer la convolution et obtenir la carte de corrélation\n",
|
||
"def get_patch(fragment,psize,n,m):\n",
|
||
" return fragment[:,:,n*psize:(n+1)*psize,m*psize:(m+1)*psize]\n",
|
||
"###################################################################################################################\n",
|
||
"class Net(nn.Module):\n",
|
||
" def __init__(self,frag_size,psize):\n",
|
||
" super(Net, self).__init__()\n",
|
||
" \n",
|
||
" h_fr=frag_size\n",
|
||
" w_fr=frag_size\n",
|
||
" \n",
|
||
" n=int(h_fr/psize) # n*m patches dans le patch d'entrée\n",
|
||
" m=int(w_fr/psize)\n",
|
||
" \n",
|
||
" self.conv1 = nn.Conv2d(3,8,kernel_size=3,stride=1,padding=1)\n",
|
||
" # Si vous souhaitez initialiser Conv1 avec les poids de DeepMatch, exécutez la ligne suivante\n",
|
||
" # self.conv1.weight=ini()\n",
|
||
" self.Relu = nn.ReLU(inplace=True)\n",
|
||
" self.maxpooling=nn.MaxPool2d(3,stride=2, padding=1)\n",
|
||
" \n",
|
||
" self.shift1=nn.Conv2d(n*m,n*m,kernel_size=3,stride=1,padding=1)\n",
|
||
" self.shift1.weight=kernel_shift_ini(n,m)\n",
|
||
" self.add1 = nn.Conv2d(n*m,int(n/2)*int(m/2),kernel_size=1,stride=1,padding=0)\n",
|
||
" self.add1.weight=kernel_add_ini(n,m)\n",
|
||
" \n",
|
||
" n=int(n/2)\n",
|
||
" m=int(m/2)\n",
|
||
" if n>=2 and m>=2:# Si n=m=1,Notre réseau n'a plus besoin de plus de couches pour agréger les cartes de corrélation\n",
|
||
" self.shift2=nn.Conv2d(n*m,n*m,kernel_size=3,stride=1,padding=1)\n",
|
||
" self.shift2.weight=kernel_shift_ini(n,m)\n",
|
||
" self.add2 = nn.Conv2d(n*m,int(n/2)*int(m/2),kernel_size=1,stride=1,padding=0)\n",
|
||
" self.add2.weight=kernel_add_ini(n,m)\n",
|
||
" \n",
|
||
" n=int(n/2)\n",
|
||
" m=int(m/2)\n",
|
||
" if n>=2 and m>=2:\n",
|
||
" self.shift3=nn.Conv2d(n*m,n*m,kernel_size=3,stride=1,padding=1)\n",
|
||
" self.shift3.weight=kernel_shift_ini(n,m)\n",
|
||
" self.add3 = nn.Conv2d(n*m,int(n/2)*int(m/2),kernel_size=1,stride=1,padding=0)\n",
|
||
" self.add3.weight=kernel_add_ini(n,m)\n",
|
||
" \n",
|
||
" def get_descripteur(self,img,using_cuda):\n",
|
||
" # Utilisez Conv1 pour calculer le descripteur,\n",
|
||
" descripteur_img=self.Relu(self.conv1(img))\n",
|
||
" b,c,h,w=descripteur_img.shape\n",
|
||
" couche_constante=0.5*torch.ones([1,1,h,w])\n",
|
||
" if using_cuda:\n",
|
||
" couche_constante=couche_constante.cuda()\n",
|
||
" # Ajouter une couche constante pour éviter la division par 0 lors de la normalisation\n",
|
||
" descripteur_img=torch.cat((descripteur_img,couche_constante),1)\n",
|
||
" # la normalisation\n",
|
||
" descripteur_img_norm=descripteur_img/torch.norm(descripteur_img,dim=1)\n",
|
||
" return descripteur_img_norm\n",
|
||
" \n",
|
||
" def forward(self,img,frag,using_cuda):\n",
|
||
" psize=4\n",
|
||
" # Utilisez Conv1 pour calculer le descripteur,\n",
|
||
" descripteur_input1=self.get_descripteur(img,using_cuda)\n",
|
||
" descripteur_input2=self.get_descripteur(frag,using_cuda)\n",
|
||
" \n",
|
||
" b,c,h,w=frag.shape\n",
|
||
" n=int(h/psize)\n",
|
||
" m=int(w/psize)\n",
|
||
" \n",
|
||
" #######################################\n",
|
||
" # Calculer la carte de corrélation par convolution pour les n*m patchs plus petit.\n",
|
||
" for i in range(n):\n",
|
||
" for j in range(m):\n",
|
||
" if i==0 and j==0:\n",
|
||
" map_corre=F.conv2d(descripteur_input1,get_patch(descripteur_input2,psize,i,j),padding=2)\n",
|
||
" else:\n",
|
||
" a=F.conv2d(descripteur_input1,get_patch(descripteur_input2,psize,i,j),padding=2)\n",
|
||
" map_corre=torch.cat((map_corre,a),1)\n",
|
||
" ########################################\n",
|
||
" # Étape de polymérisation\n",
|
||
" map_corre=self.maxpooling(map_corre)\n",
|
||
" map_corre=self.shift1(map_corre)\n",
|
||
" map_corre=self.add1(map_corre)\n",
|
||
" \n",
|
||
" #########################################\n",
|
||
" # Répétez l'étape d'agrégation jusqu'à obtenir le graphique de corrélation du patch d'entrée\n",
|
||
" n=int(n/2)\n",
|
||
" m=int(m/2)\n",
|
||
" if n>=2 and m>=2:\n",
|
||
" map_corre=self.maxpooling(map_corre)\n",
|
||
" map_corre=self.shift2(map_corre)\n",
|
||
" map_corre=self.add2(map_corre)\n",
|
||
" \n",
|
||
" \n",
|
||
" n=int(n/2)\n",
|
||
" m=int(m/2)\n",
|
||
" if n>=2 and m>=2:\n",
|
||
" map_corre=self.maxpooling(map_corre)\n",
|
||
" map_corre=self.shift3(map_corre)\n",
|
||
" map_corre=self.add3(map_corre)\n",
|
||
" \n",
|
||
" \n",
|
||
" b,c,h,w=map_corre.shape\n",
|
||
" # Normalisation de la division par maximum\n",
|
||
" map_corre=map_corre/(map_corre.max())\n",
|
||
" # Normalisation SoftMax\n",
|
||
" #map_corre=(F.softmax(map_corre.reshape(1,1,h*w,1),dim=2)).reshape(b,c,h,w)\n",
|
||
" return map_corre"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"def run_net(net,img,frag,frag_size,using_cuda):\n",
|
||
" h,w,c=frag.shape\n",
|
||
" n=int(h/frag_size)\n",
|
||
" m=int(w/frag_size)\n",
|
||
" frag_list=[]\n",
|
||
" #####################################\n",
|
||
" # Obtenez des patchs carrés des fragments et mettez-les dans la frag_list\n",
|
||
" for i in range(n):\n",
|
||
" for j in range(m):\n",
|
||
" frag_32=frag[i*frag_size:(i+1)*frag_size,j*frag_size:(j+1)*frag_size]\n",
|
||
" if test_fragment32_32(frag_32,0.6):\n",
|
||
" frag_list.append(frag_32)\n",
|
||
" img_tensor=img2tensor(img)\n",
|
||
" ######################################\n",
|
||
" if using_cuda:\n",
|
||
" img_tensor=img_tensor.cuda()\n",
|
||
" \n",
|
||
" coordonnee_list=[]\n",
|
||
" #######################################\n",
|
||
" # Utilisez le réseau pour calculer les positions de tous les patchs dans frag_list[]\n",
|
||
" # Mettez le résultat du calcul dans coordonnee_list[]\n",
|
||
" for i in range(len(frag_list)):\n",
|
||
" frag_tensor=img2tensor(frag_list[i])\n",
|
||
" if using_cuda:\n",
|
||
" frag_tensor=frag_tensor.cuda()\n",
|
||
" res=net.forward(img_tensor,frag_tensor,using_cuda)\n",
|
||
" if using_cuda:\n",
|
||
" res=res.cpu()\n",
|
||
" po_h,po_w=show_coordonnee(res)\n",
|
||
" coordonnee_list.append([po_h,po_w])\n",
|
||
" h_img,w_img,c=img.shape\n",
|
||
" position=[]\n",
|
||
" for i in range(len(coordonnee_list)):\n",
|
||
" x=int(round(h_img*coordonnee_list[i][0]))\n",
|
||
" y=int(round(w_img*coordonnee_list[i][1]))\n",
|
||
" position.append([x,y])\n",
|
||
" return position"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 8,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"if __name__=='__main__':\n",
|
||
" \n",
|
||
" # La taille du patch d'entrée est de 16*16\n",
|
||
" frag_size=16\n",
|
||
" # La taille du plus petit patch dans réseau est de 4 *4 fixée\n",
|
||
" psize=4\n",
|
||
" using_cuda=True\n",
|
||
" \n",
|
||
" \n",
|
||
" net=Net(frag_size,psize)\n",
|
||
" \n",
|
||
" # Pour chaque fresque, le nombre d'itérations est de 1000\n",
|
||
" itera=1000\n",
|
||
" \n",
|
||
" if using_cuda:\n",
|
||
" net=net.cuda()\n",
|
||
" \n",
|
||
" # Choisissez l'optimiseur et la fonction de coût\n",
|
||
" optimizer = torch.optim.Adam(net.parameters())\n",
|
||
" loss_func = torch.nn.MSELoss()\n",
|
||
" \n",
|
||
" # Dans le processus d'apprentissage du réseau,le changement d'erreur est placé dans loss_value=[] \n",
|
||
" # et le changement de Conv1 poids est placé dans para_value[]\n",
|
||
" loss_value=[]\n",
|
||
" para_value=[]\n",
|
||
" ####################################################training_net\n",
|
||
" \n",
|
||
" #Les données d'entraînement sont 6 fresques\n",
|
||
" N_fresque = 6\n",
|
||
" for fresque_id in range(N_fresque):\n",
|
||
" im_path=\"./training_data/fresque{}.ppm\".format(fresque_id)\n",
|
||
" img_training=cv2.imread(im_path)\n",
|
||
" h,w,c=img_training.shape\n",
|
||
" \n",
|
||
" # Si la peinture murale est trop grande, sous-échantillonnez-la et rétrécissez-la\n",
|
||
" while h*w>(1240*900):\n",
|
||
" img_training=cv2.resize(img_training,(int(h/2),int(w/2)),interpolation=cv2.INTER_CUBIC)\n",
|
||
" h,w,c=img_training.shape\n",
|
||
" im_tensor=img2tensor(img_training)\n",
|
||
" \n",
|
||
" if using_cuda:\n",
|
||
" im_tensor=im_tensor.cuda()\n",
|
||
" for i in range(itera):\n",
|
||
" # Tous les 100 cycles, enregistrez le changement de poids\n",
|
||
" if i%100==0:\n",
|
||
" para=net.conv1.weight\n",
|
||
" para=para.detach().cpu()\n",
|
||
" para_value.append(para)\n",
|
||
" frag,vt=get_training_fragment(frag_size,img_training)\n",
|
||
" frag_tensor=img2tensor(frag)\n",
|
||
" if using_cuda:\n",
|
||
" vt=vt.cuda()\n",
|
||
" frag_tensor=frag_tensor.cuda()\n",
|
||
" # Utilisez des patchs et des fresques de données d'entraînement pour faire fonctionner le réseau\n",
|
||
" frag_pred=net.forward(im_tensor,frag_tensor,using_cuda)\n",
|
||
" b,c,h,w=vt.shape\n",
|
||
" # Utilisez la fonction de coût pour calculer l'erreur\n",
|
||
" err_=loss_func(vt,frag_pred)\n",
|
||
" # Utilisez l'optimiseur pour ajuster le poids de Conv1\n",
|
||
" optimizer.zero_grad()\n",
|
||
" err_.backward(retain_graph=True)\n",
|
||
" optimizer.step()\n",
|
||
" \n",
|
||
" loss_value.append(err_.tolist())\n",
|
||
" \n",
|
||
" del frag_tensor,frag_pred,err_,vt\n",
|
||
" torch.cuda.empty_cache()\n",
|
||
" \n",
|
||
" # sauvegarder le réseau dans le fichier \"net_trainned6000\"\n",
|
||
" file_path=\"./net_trainned6000\"\n",
|
||
" save_net(file_path,net)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 7,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"6000"
|
||
]
|
||
},
|
||
"execution_count": 7,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"len(loss_value)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 11,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"[<matplotlib.lines.Line2D at 0x7f2b3292d048>]"
|
||
]
|
||
},
|
||
"execution_count": 11,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
},
|
||
{
|
||
"data": {
|
||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deXxU1fk/8M+TBAhbQCAsQiCArCKbYXFBXIqC9FvcFat1Q0q/ot8Wa4uK1qL8RKxbKxYRrFoEqlVEDYuyo4AQAoEAiYQlJGFJSEhICNnP74+5mcxyZ+ZmMtudfN6vFy9m7j1z55wQnjlz7jnPEaUUiIjI/CKCXQEiIvINBnQiojDBgE5EFCYY0ImIwgQDOhFRmIgK1ht36NBBxcfHB+vtiYhMaffu3WeVUrF654IW0OPj45GUlBSstyciMiURyXR1jkMuRERhggGdiChMMKATEYUJBnQiojBhKKCLyHgRSReRDBGZ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<Figure size 432x288 with 1 Axes>"
|
||
]
|
||
},
|
||
"metadata": {
|
||
"needs_background": "light"
|
||
},
|
||
"output_type": "display_data"
|
||
}
|
||
],
|
||
"source": [
|
||
"plt.plot(loss_value)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 12,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"file_path=\"./net_trainned6000\"\n",
|
||
"save_net(file_path,net)"
|
||
]
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 3",
|
||
"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.5"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 4
|
||
}
|