앎을 경계하기

DAFIT 66

<DAFIT> 02 딥러닝으로 은하 분류하기 03 - CNN

이번에는 CNN모델을 구성해보는 문제다. 딥러닝을 이용한 은하 분류는 CNN을 사용하여 50x50 사이즈의 3가지 종류의 은하 이미지를 분류하는 것이다. model.add(layers.Conv2D(32, (3,3), activation='relu', input_shape=(50,50,3))) model.add(layers.MaxPooling2D((2,2))) model.add(layers.Conv2D(64, (3,3), activation='relu')) model.add(layers.Flatten()) model.add(layers.Dense(128, activation='relu')) model.add(layers.Dense(3, activation='softmax')) 문제에서 시킨대로 모델 구성 ..

<DAFIT> 02 딥러닝으로 은하 분류하기 02 - Image Data Generator

이 문제를 풀다가 정리했던 포스트를 링크한다. 2019/10/16 - [Study/Deep Learning] - Keras - ImageDataGenerator Keras - ImageDataGenerator Keras - ImageDataGenerator Keras에서 이미지 데이터를 학습할 때 실시간으로 data augmentation을 할 수 있도록 지원하는 클래스로 ImageDataGenerator가 있다. from keras_preprocessing.image import ImageDat.. whereisend.tistory.com 문제는 ImageDataGenerator를 사용하기 위해서 필요한 아래 코드의 A, B, C, D를 채우는 것이다. train_datagen = ImageDataGe..

<DAFIT> 02 딥러닝으로 은하 분류하기 01 - Import

DF901 데이터 전처리하기에 이어 이번에는 딥러닝으로 은하분류하기! CNN 모델을 구현해서 은하 이미지를 분류해보는 문제이다. Keras는 일단 Tensorflow를 base로 두고 있는 high-level API 이다. Keras Document 참고 Home - Keras Documentation Keras: The Python Deep Learning library You have just found Keras. Keras is a high-level neural networks API, written in Python and capable of running on top of TensorFlow, CNTK, or Theano. It was developed with a focus on enabl..

<DAFIT> 01 자연어 데이터 전처리 연습 - 03 사전순 배열시키기

import re filePath = 'drive/My Drive/다핏문제/01/Beta01_NLP.txt' p = re.compile('[ A-Z-a-z]') f = open(filePath, mode='r', encoding='euc-kr') s = f.read() f.close() s = p.findall(s) print(s) s = ''.join(s).split(' ') s = list(set(s)) for i in range(len(s)): s[i] = s[i].lower() s = sorted(s) f = open('drive/My Drive/다핏문제/03/DF901_03_이름.txt', mode='w', encoding='euc-kr') f.write('\n'.join(s)) f...

<DAFIT> 01 자연어 데이터 전처리 연습 - 02 알파벳을 한글로

import pandas as pd soundPath = 'drive/My Drive/다핏문제/02/NLP02_Sound.xlsx' data = pd.read_excel(soundPath) f = open('drive/My Drive/다핏문제/01/Beta01_NLP.txt', mode='r', encoding='euc-kr') s = f.read() buf = '' for s in s: s = s.upper() if s in data: s = s.replace(s, data[s][0]) buf += s f = open('drive/My Drive/다핏문제/02/DF901_02_이름.txt', mode='w', encoding='euc-kr') f.write(buf) f.close() 한영 대..

<DAFIT> 01 자연어 데이터 전처리 연습 - 01 특수 기호 제거

import re inputFile = 'Beta01_NLP.txt' outputFile = 'DF901_01_이름.txt' p = re.compile('[ ㄱ-ㅣ가-힣A-Za-z]') f = open(inputFile, mode='r', encoding='euc-kr') s = f.read() f.close() s = p.findall(s) s = ''.join(s) print(s) f = open(outputFile, mode='w', encoding='euc-kr') f.write(s) f.close() 나는 정규표현식 처리를 사용해서 특수 문자를 제거했다. 한글 처리 방법을 몰랐었는데 자,모음 'ㄱ-ㅣ' 과 음절 '가-힣' 을 알파벳 대소문자 'A-Z', 'a-z' 와 함께 []를 사용하여 문자클..