일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- mme paper
- BYOL
- Meta Pseudo Labels
- WGAN
- shrinkmatch paper
- UnderstandingDeepLearning
- 컴퓨터구조
- simclrv2
- 딥러닝손실함수
- shrinkmatch
- 최린컴퓨터구조
- cifar100-c
- remixmatch paper
- GAN
- conjugate pseudo label paper
- CoMatch
- Pix2Pix
- tent paper
- Entropy Minimization
- dann paper
- mocov3
- ConMatch
- CycleGAN
- SSL
- 백준 알고리즘
- CGAN
- dcgan
- adamatch paper
- semi supervised learnin 가정
- Pseudo Label
- Today
- Total
목록딥러닝/파이토치 33
Hello Data
텐서 데이터에 적용되는 여러 메소드들이 있는데 이를 한번 정리해보려고 한다. tensor.data x = torch.tensor[1,2] printx printx.data y = torch.rand3,5 printy.data tensor[1,2] tensor[1,2] tensor[[0.7150,0.9495,0.3474,0.3829,0.2828],[0.4531,0.4677,0.0863,0.6763,0.2480],[0.6295,0.0573,0.5454,0.4892,0.5464]] x, y = nextiter(loader) printx.shape printx[1].data torch.Size[32,3,32,32] tensor([[[0..
1. 데이터의 개수는 같지만 각각의 해당되는 데이터 라벨은 다르다. file_path = '/content/CIFAR-100-C/labels.npy' data_array = np.loadfilepath print"데이터 형태:", data_array.shape print"데이터 내용:" cor = np.arraycifar_dataset.targets == data_array printnp.sum(cor) 데이터 형태: 50000, 데이터 내용: 475 2. 제일 놀라운 사실. CIFAR100 C 에는 50,000개의 단순한 노이즈 데이터들이 있는 것이 아닌, 10,000개 묶음으로 severity 가 높아진다. 한마디로 처음 10개의 이미지와, 10000~10010번째 이미지, 2..
corrupted 된 이미지들을 다루다보면은 여러 개의 데이터셋을 다루다보니 코드가 더러워질 수 있다. 이에 대해서 코드의 간편성을 위해서는 데이터셋을 합칠 수 있다. mnist = datasets.MNISTroot = './sample_data', train = True, download =True, transform = transforms.ToTensor() cifar = datasets.CIFAR10root = './sample_data', train = True, download = True, transform = transforms.ToTensor() concat = torch.utils.data.ConcatDataset[cifar, mnist] printlen(concat) pr..
이번에 논문에 나온 값들이 어떻게 변하는지 알아보려던 찰나에 아무 생각 없이 * 연산자를 쓰니까 원하던 값들이 안나와서 적어두려고 한다. x = torch.tensor[[0.85, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.07]] xt = torch.transposex, 0, 1 i = torch.eye10 diag = torch.diagx xx = xt * x k = i + 8*i - 8*xx k = torch.inversek pseudo = k.matmulxt p = torch.mulk, xt.sum0 printxt.shape printx.shape printi.shape printxx.shape print..
딥러닝 훈련을 시키면서 가벼운 텐서로 세팅할 때도 있는데 이럴 때마다 구글을 서칭한다.. 그래서 torch의 가벼운 문법을 정리해보려고 한다. a = torch.tensor1 b = torch.tensor[1] c = torch.tensor[[1,2, 3], [3,4,5]] printa printa.shape printb printb.shape printc printc.shape tensor1 torch.Size[] tensor[1] torch.Size[1] tensor[[1, 2, 3], [3, 4, 5]] torch.Size[2, 3] 이렇게 가벼운 텐서 정도는 torch.tensor를 사용해서 생성할 수 있다. a = torch.arange(1,..
아주 가끔 loss를 찍어보면 nan을 만날 수 있다. 내 경우는 loss 미분에 대해 learning rate를 낮추니 해결되었는데 이유에 대해서 한번 간단한 코드로 실험해보려고 한다. a = torch.exptorch.tensor(100) b = torch.tensor100 printa printtorch.log(a) printa / a softmax에 기본적으로 exp가 사용되니 적용해보았다. tensorinf tensorinf tensornan 결과는 이렇게 나오는데 즉 inf는 너무 높은 값이 나오면 컴퓨터에서 처리하지 못하는 것을 알 수 있다. 음의 방향으로 너무 크다면 -inf라는 결과가 나온다. 세번째에 나온 nan같은 경우 무한대 / 무한대 이런 값을 넣으니 ..
2개의 동일 모델이 있고 한개는 이미 학습이 어느 정도 됐고 다른 1개는 초기화 상태이다. 학습이 어느 정도 된 모델의 파라미터를 안된 모델의 가중치로 넘겨주고, 이 모델에 대해서 학습을 시킨다. 그렇다면 기존 넘겨준 모델의 가중치는 업데이트가 될까? 직관적으로는 안될 거 같지만 실험을 해봤다. import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F x_train = torch.FloatTensor[[1], [2], [3]] y_train = torch.FloatTensor[[2], [4], [6]] layer = nn.Linear1, 1 layerc = nn.Linear(1, 1..

이번에 실험하면서 CIFAR10-C 데이터셋을 다루게되었는데 시행착오도 많아가지고 공유해보려고 한다. 우선 https://zenodo.org/records/2535967 사이트에서 CIFAR10-C 데이터 다운로드 링크를 복사 후 터미널에 wget {dataest link} 를 하면된다. colab환경이라면 !wget하면 된다 그렇다면 tar를 확장자로 하는 압축파일을 다운로드 받게 되는데 압축을 푸는데 다양한 방법이 있지만 import tarfile tar = tarfile.open'/content/CIFAR-10-C.tar?download=1', 'r' tar.extractall tar.close 이렇게 한다면 압축 파일을 해제할 수 있다위 환경은 colab환경이다 그렇다면 이렇게 많은..