ML&DL(수정 중)14 신경망 모델 훈련 7.3 신경망 모델 훈련¶ 손실 곡선¶ In [13]: from tensorflow import keras (train_input, train_target), (test_input, test_target) = keras.datasets.fashion_mnist.load_data() train_scaled = train_input / 255.0 from sklearn.model_selection import train_test_split train_scaled, val_scaled, train_target, val_target = train_test_split(train_scaled, train_target, test_size = 0.2, random_state=42) In [14]: def model_f.. 2022. 3. 22. 심층 신경망 7.2 심층 신경망¶ 2개의 층¶ 은닉층 : 입력층과 출력층 사이에 있는 모든 층¶ In [1]: from tensorflow import keras (train_input, train_target), (test_input, test_target) = keras.datasets.fashion_mnist.load_data() Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/train-labels-idx1-ubyte.gz 32768/29515 [=================================] - 0s 0us/step Downloading data from https://storage.googlea.. 2022. 3. 22. 인공 신경망 7.1 인공신경망¶ 패션 MNIST¶ In [1]: from tensorflow import keras (train_input, train_target), (test_input, test_target) = keras.datasets.fashion_mnist.load_data() Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/train-labels-idx1-ubyte.gz 32768/29515 [=================================] - 0s 0us/step Downloading data from https://storage.googleapis.com/tensorflow/tf-kera.. 2022. 3. 22. 주성분 분석 주성분분석(PCA)¶ 데이터에 있는 분산이 큰 방향을 찾는 것¶ 주성분 : 원본 데이터에 있는 어떤 방향¶ 주성분 벡터의 원소 개수는 원본 데이터셋에 있는 특성 개수와 동일¶ 주성분은 원본 차원과 같고 주성분으로 바꾼 데이터는 차원이 줄어든다¶ In [4]: !wget https://bit.ly/fruits_300 -O fruits_300.npy import numpy as np fruits = np.load('fruits_300.npy') fruits_2d = fruits.reshape(-1,100*100) --2021-03-24 11:09:09-- https://bit.ly/fruits_300 Resolving bit.ly (bit.ly)... 67.199.248.11, 67.199.248.10 Co.. 2022. 3. 22. 이전 1 2 3 4 다음