[PyTorch] Evaluating 및 Predicting
이전 블로그를 이어서 진행해본다. Evaluation model.train() 모드로 변한 것 처럼 평가할 때는 model.eval() 으로 설정한다. 1234567891011# Test mode# batch norm이나 dropout 등을 train mode 변환model.eval()# OutNet( (conv1): Conv2d(1, 20, kerne
이전 블로그를 이어서 진행해본다. Evaluation model.train() 모드로 변한 것 처럼 평가할 때는 model.eval() 으로 설정한다. 1234567891011# Test mode# batch norm이나 dropout 등을 train mode 변환model.eval()# OutNet( (conv1): Conv2d(1, 20, kerne
Optimization & Training https://github.com/pytorch/examples/tree/master/mnist Load Packages 1234567import torchimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim as optimfrom
PyTorch Layer 이해하기 Load Packages 123456import torchfrom torchvision import datasets, transformsimport numpy as npimport matplotlib.pyplot as plt%matplotlib inline 예제 불러오기 1234567891011train_loader
PyTorch Data Preprocess 12import torchfrom torchvision import datasets, transforms Import Error 1ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' pillow 버전이 7.0.0 이상 일경우 Import 에러 나는 경우가
Load Packages 12import numpy as npimport torch Basic PyTorch 기초 사용법 1234nums = torch.arange(9)nums.shapenums.numpy()nums.reshape(3, 3) 1234randoms = torch.rand((3, 3))zeros = torch.zeros((3, 3))ones
Load Packages 1234import tensorflow as tffrom tensorflow.keras import layersfrom tensorflow.keras import datasets Build Model 123456789101112131415161718192021222324252627input_shape = (28, 28, 1)nu
TensorFlow 공식 홈페이지에서 설명하는 Expert 버전을 사용해본다. Load Packages 1234import tensorflow as tffrom tensorflow.keras import layersfrom tensorflow.keras import datasets 학습 과정 돌아보기 Build Model 12345678910111
Load Packages 1234import tensorflow as tffrom tensorflow.keras import layersfrom tensorflow.keras import datasets 학습 과정 돌아보기 Prepare MNIST Datset 1(train_x, train_y), (test_x, test_y) = datasets.m
Load Packages 12345import tensorflow as tfimport osimport matplotlib.pyplot as plt%matplotlib inline Input Image 1234567891011from tensorflow.keras import datasets(train_x, train_y), (test_x, test_y
Load Packages 123456import numpy as npimport matplotlib.pyplot as pltimport tensorflow as tf%matplotlib inline 데이터 불러오기 TensorFlow 에서 제공해주는 데이터셋(MNIST) 예제 불러오기다. 12345678from tensorflow.keras import