인공지능

    딥러닝 : validation data와 Callback(EarlyStopping Library) 사용법

    1. validation def build_model(): model = Sequential() model.add(Dense(units=64,activation='relu',input_shape=(9,))) model.add(Dense(units=64,activation='relu')) model.add(Dense(units=1,activation='linear')) model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.001),loss='mse',metrics=['mse','mae']) return model model=build_model() model.summary() 위 코드와 같이 모델링을 끝냈다. 이제 위에서 만든 model이라는 ..

    딥러닝 : learning rate를 optimizer에 셋팅하기.

    이전에는 아래와같이 코드를 작성하였다. model.compile(optimizer='Adam',loss='mse' 오차가 최소가 되는 점을 찾아야하는데, 아래 사진을 보면 너무 오래 걸릴 수도 있고, 지나칠 수도 있다 그래서 모델링을 하는 과정에 아래 코드와 같이 learning rate를 설정해 줄 수 있다. def build_model(): model = Sequential() model.add(Dense(units=64,activation='relu',input_shape=(9,))) model.add(Dense(units=64,activation='relu')) model.add(Dense(units=1,activation='linear')) model.compile(optimizer=tf.ker..

    딥러닝 : Tensorflow로 리그레션 문제 모델링 하는 방법

    우선 사용할 라이브러리들 import후 데이터 프레임을 불러옵니다. import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns csv 파일을 읽기 위해, 구글 드라이브 마운트를 진행합니다. from google.colab import drive drive.mount('/content/drive') working directory 를, 현재의 파일이 속한 폴더로 셋팅합니다. import os os.chdir('/content/drive/MyDrive/Colab Notebooks/ml_plus/data') 데이터 프레임을 불러옵니다. df = pd.read_csv('Car_Purchasing_Data...

    딥러닝 : GridSearch를 이용한 최적의 하이퍼 파라미터 찾기

    # Tuning the ANN from keras.wrappers.scikit_learn import KerasClassifier from sklearn.model_selection import GridSearchCV from keras.models import Sequential from keras.layers import Dense 우선 필요한 라이브러리들을 임포트 해줍니다. # tensorflow로 그리드서치 하기 위해서 # 1. 모델링하는 함수를 만든다. from keras.layers.attention.multi_head_attention import activation def build_model(optimizer): # 모델링 model = Sequential() model.add(Dense..