스터디 노트 (tensorflow, MNIST | CNN)
📌 MNIST 🔻데이터 import → 각 픽셀이 255값이 최댓값이기 때문에, 0과 1사이의 값으로 조정 (min-max scaler 느낌) → OneHotEncoding 방식이나, sparse_categorical_crossentropy로 설정 가능 import tensorflow as tf mnist = tf.keras.datasets.mnist (X_train, y_train), (X_test, y_test) = mnist.load_data() x_train, x_test, =x_train / 255.0, x_test/255.0 🔻Modeling model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(input_shape=(28,28)), tf..
스터디 노트 (tensorflow, Regression | XOR)
📌Blood Fat Data (Regression) 🔻데이터 import → index, 구분선, weight, age, blood fat 순으로 나열되어있다. import numpy as np raw_data = np.genfromtxt('./data/x09.txt', skip_header=36) raw_data >>>> array([[ 1., 1., 84., 46., 354.], [ 2., 1., 73., 20., 190.], [ 3., 1., 65., 52., 405.], [ 4., 1., 70., 30., 263.], [ 5., 1., 76., 57., 451.], [ 6., 1., 69., 25., 302.], [ 7., 1., 63., 28., 288.], [ 8., 1., 72., 36., ..