Thief of Wealth




출처=> https://tykimos.github.io/DeepBrick/





DeepBrick for Keras (케라스를 위한 딥브릭)

The Keras is a high-level API for deep learning model. The API is very intuitive and similar to building bricks. So, I have started the DeepBrick Project to help you understand Keras’s layers and models.

딥러닝과 케라스를 공부하면서 느낀 점은 층을 쌓고 모델을 만들고 하는 과정들이 블록 쌓는 것과 비슷한 느낌을 많이 받았고, 실제로 딥러닝 모델을 설명할 때 블록 그림을 많이 이용하기도 했습니다. 그러다가 (실제 혹은 웹에서) 블록을 쌓으면 딥러닝 모델까지 자동으로 만들 수 있겠다는 생각이 들었습니다. 그래서 딥브릭(DeepBrick)이란 이름으로 프로젝트를 진행해볼까 합니다.


Bricks

There are bricks supported by DeepBrick.

Dataset

BrickNameDescription
imgInput data, LabelsInput data and labels are encoded as vector.
1차원의 입력 데이터 및 라벨입니다.
img2D Input dataInput data are encoded as 2D vector.
2차원의 입력 데이터입니다.

In case of imagery, the dimention consists of sample, width, height and channel.
주로 영상 데이터를 의미하며 샘플수, 너비, 높이, 채널수로 구성됩니다.

Layers

BrickNameDescription
imgDenseRegular densely-connected neual network layer.
모든 입력 뉴런과 출력 뉴런을 연결하는 전결합층입니다.
imgEmbeddingTurns positive integer representations of words into a word embedding.
단어를 의미론적 기하공간에 매핑할 수 있도록 벡터화시킵니다.
imgConv1DExtracts local features using 1D filters.
필터를 이용하여 지역적인 특징을 추출합니다.
imgConv2DExtracts local features of images using 2D filters.
필터를 이용하여 영상 특징을 추출합니다.
imgGlobalMaxPooling1DReturns the largest vector of several input vectors.
여러 개의 벡터 정보 중 가장 큰 벡터를 골라서 반환합니다.
imgMaxPooling1DReturns the largest vectors of specific range of input vectors.
입력벡터에서 특정 구간마다 값을 골라 벡터를 구성한 후 반환합니다.
imgMaxPooling2DReduces to affect feature extaction by minor changes in the image.
영상에서의 사소한 변화가 특징 추출에 크게 영향을 미치지 않도록 합니다.
imgFlattenFlattens the input.
2차원의 특징맵을 전결합층으로 전달하기 위해서 1차원 형식으로 바꿔줍니다.
imgLSTMLong-Short Term Memory unit, one of RNN layer.
Long-Short Term Memory unit의 약자로 순환 신경망 레이어 중 하나입니다.
imgDropoutExcludes random input neurons (one-dimensional) at a specified rate during learning to prevent overfitting.
과적합을 방지하기 위해서 학습 시에 지정된 비율만큼 임의의 입력 뉴런(1차원)을 제외시킵니다.
imgDropoutExcludes random input neurons (two-dimensional) at a specified rate during learning to prevent overfitting.
과적합을 방지하기 위해서 학습 시에 지정된 비율만큼 임의의 입력 뉴런(2차원)을 제외시킵니다.

Activation Functions

BrickNameDescription
imgsigmoidReturns a value between 0 and 1.
활성화 함수로 입력되는 값을 0과 1사이의 값으로 출력시킵니다.

This is mainly used for the activation function of the output layer of the binary classification model it can be judged as positive if the output value is above a certain threshold value (for example, 0.5) or negative if it is below.
출력값이 특정 임계값(예를 들어 0.5) 이상이면 양성, 이하이면 음성이라고 판별할 수 있기 때문에 이진분류 모델의 출력층에 주로 사용됩니다.
imgsoftmaxReturns the probability value per class.
활성화 함수로 입력되는 값을 클래스별로 확률 값이 나오도록 출력시킵니다.

If all of these probabilities are added, it becomes 1.
이 확률값을 모두 더하면 1이 됩니다.

It is used mainly for the activation function of the output layer of a multi-class model, and the class with the highest probability value is the class classified by the model.
다중클래스 모델의 출력층에 주로 사용되며, 확률값이 가장 높은 클래스가 모델이 분류한 클래스입니다.
imgtanhReturns a value between -1 and 1.
활성화 함수로 입력되는 값을 -1과 1사이의 값으로 출력시킵니다.

It is used for the activation function of LSTM layer.
LSTM의 출력 활성화 함수로 사용됩니다.
imgreluIt is mainly used of the activation funition of the hidden layer.
활성화 함수로 주로 은닉층에 사용됩니다.
imgreluIt is mainly used of the activation funition of the hidden layer such as Conv2D.
활성화 함수로 주로 Conv2D 은닉층에 사용됩니다.

Models

Numerical Input / Numerical Prediction - Perceptron NN Model 
(수치입력 수치예측 퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(1, input_dim=1))

more…

Numerical Input / Numerical Prediction - MLP NN Model
(수치입력 수치예측 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(64, input_dim=1, activation='relu'))
model.add(Dense(1))

more…

Numerical Input / Binary Classification - Deep MLP NN Model
(수치입력 수치예측 깊은 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(64, input_dim=1, activation='relu'))
model.add(Dense(64, activation='relu'))
model.add(Dense(1))

more…

Numerical Input / Binary Classification - Perceptron NN Model
(수치입력 이진분류 퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(1, input_dim=12, activation='sigmoid'))

more…

Numerical Input / Binary Classification - MLP NN Model
(수치입력 이진분류 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(64, input_dim=12, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

more…

Numerical Input / Binary Classification - Deep MLP NN Model
(수치입력 이진분류 깊은 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(64, input_dim=12, activation='relu'))
model.add(Dense(64, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

more…

Numerical Input / Multiclass Classification - Perceptron NN Model
(수치입력 다중클래스분류 퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(10, input_dim=12, activation='softmax'))

more…

Numerical Input / Multiclass Classification - MLP NN Model
(수치입력 다중클래스분류 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(64, input_dim=12, activation='relu'))
model.add(Dense(10, activation='softmax'))

more…

Numerical Input / Multiclass Classification - Deep MLP NN Model
(수치입력 다중클래스분류 깊은 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(64, input_dim=12, activation='relu'))
model.add(Dense(64, activation='relu'))
model.add(Dense(10, activation='softmax'))

more…

Image Input / Numerical Prediction - MLP NN Model
(영상입력 수치예측 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(256, activation='relu', input_dim = width*height))
model.add(Dense(256, activation='relu'))
model.add(Dense(256))
model.add(Dense(1))

more…

Image Input / Numerical Prediction - CNN Model
(영상입력 수치예측 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(width, height, 1)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dense(1))

more…

Image Input / Binary Classification - MLP NN Model
(영상입력 이진분류 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(256, input_dim=width*height, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

more…

Image Input / Binary Classification - CNN Model
(영상입력 이진분류 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(width, height, 1)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

more…

Image Input / Binary Classification - Deep CNN Model
(영상입력 이진분류 깊은 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(width, height, 1)))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(1, activation='sigmoid'))

more…

Image Input / Multiclass Classification - MLP NN Model
(영상입력 다중클래스분류 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(256, input_dim=width*height, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(10, activation='softmax'))

more…

Image Input / Multiclass Classification - CNN Model
(영상입력 다중클래스분류 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(width, height, 1)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dense(10, activation='softmax'))

more…

Image Input / Multiclass Classification - Deep CNN Model
(영상입력 다중클래스분류 깊은 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(width, height, 1)))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(10, activation='softmax'))

more…

Time-series Numerical Input / Numerical Prediction - MLP NN Model
(시계열수치입력 수치예측 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Dense(32,input_dim=40,activation="relu"))
model.add(Dropout(0.3))
for i in range(2):
    model.add(Dense(32,activation="relu"))
    model.add(Dropout(0.3))
model.add(Dense(1))

more…

Time-series Numerical Input / Numerical Prediction - RNN Model
(시계열수치입력 수치예측 순환신경망 모델)

img

model = Sequential()
model.add(LSTM(32, input_shape=(None, 1)))
model.add(Dropout(0.3))
model.add(Dense(1))

more…

Time-series Numerical Input / Numerical Prediction - Stateful RNN Model
(시계열수치입력 수치예측 상태유지 순환신경망 모델)

img

model = Sequential()
model.add(LSTM(32, batch_input_shape=(1, look_back, 1), stateful=True))
model.add(Dropout(0.3))
model.add(Dense(1))

more…

Time-series Numerical Input / Numerical Prediction - Stateful Stack RNN Model
(시계열수치입력 수치예측 상태유지 스택 순환신경망 모델)

img

model = Sequential()
for i in range(2):
    model.add(LSTM(32, batch_input_shape=(1, look_back, 1), stateful=True, return_sequences=True))
    model.add(Dropout(0.3))
model.add(LSTM(32, batch_input_shape=(1, look_back, 1), stateful=True))
model.add(Dropout(0.3))
model.add(Dense(1))

more…

Text Input / Binary Classification - MLP NN Model
(문장입력 이진분류 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Embedding(20000, 128, input_length=200))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

more…

Text Input / Binary Classification - RNN Model
(문장입력 이진분류 순환신경망 모델)

img

model = Sequential()
model.add(Embedding(20000, 128))
model.add(LSTM(128))
model.add(Dense(1, activation='sigmoid'))

more…

Text Input / Binary Classification - CNN Model
(문장입력 이진분류 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Embedding(20000, 128, input_length=200))
model.add(Dropout(0.2))
model.add(Conv1D(256,
                 3,
                 padding='valid',
                 activation='relu',
                 strides=1))
model.add(GlobalMaxPooling1D())
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(1, activation='sigmoid'))

more…

Text Input / Binary Classification - RNN & CNN Model
(문장입력 이진분류 순환 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Embedding(20000, 128, input_length=200))
model.add(Dropout(0.2))
model.add(Conv1D(256,
                 3,
                 padding='valid',
                 activation='relu',
                 strides=1))
model.add(MaxPooling1D(pool_size=4))
model.add(LSTM(128))
model.add(Dense(1, activation='sigmoid'))

more…

Text Input / Multiclass Classification - MLP NN Model
(문장입력 다중클래스분류 다층퍼셉트론 신경망 모델)

img

model = Sequential()
model.add(Embedding(15000, 128, input_length=120))
model.add(Flatten())
model.add(Dense(256, activation='relu'))
model.add(Dense(46, activation='softmax'))

more…

Text Input / Multiclass Classification - RNN Model
(문장입력 다중클래스분류 순환신경망 모델)

img

model = Sequential()
model.add(Embedding(15000, 128))
model.add(LSTM(128))
model.add(Dense(46, activation='softmax'))

more…

Text Input / Multiclass Classification - CNN Model
(문장입력 다중클래스분류 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Embedding(15000, 128, input_length=120))
model.add(Dropout(0.2))
model.add(Conv1D(256,
                 3,
                 padding='valid',
                 activation='relu',
                 strides=1))
model.add(GlobalMaxPooling1D())
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(46, activation='softmax'))

more…

Text Input / Multiclass Classification - RNN & CNN Model
(문장입력 다중클래스분류 순환 컨볼루션 신경망 모델)

img

model = Sequential()
model.add(Embedding(max_features, 128, input_length=text_max_words))
model.add(Dropout(0.2))
model.add(Conv1D(256,
                 3,
                 padding='valid',
                 activation='relu',
                 strides=1))
model.add(MaxPooling1D(pool_size=4))
model.add(LSTM(128))
model.add(Dense(46, activation='softmax'))

more…

책 소개

img

교보문고 YES24 반디앤루이스 알라딘 인터파크

[추천사]

  • 하용호님, 카카오 데이터사이언티스트 - 뜬구름같은 딥러닝 이론을 블록이라는 손에 잡히는 실체로 만져가며 알 수 있게 하고, 구현의 어려움은 케라스라는 시를 읽듯이 읽어내려 갈 수 있는 라이브러리로 풀어준다.
  • 이부일님, (주)인사아트마이닝 대표 - 여행에서도 좋은 가이드가 있으면 여행지에 대한 깊은 이해로 여행이 풍성해지듯이 이 책은 딥러닝이라는 분야를 여행할 사람들에 가장 훌륭한 가이드가 되리라고 자부할 수 있다. 이 책을 통하여 딥러닝에 대해 보지 못했던 것들이 보이고, 듣지 못했던 것들이 들리고, 말하지 못했던 것들이 말해지는 경험을 하게 될 것이다.
  • 이활석님, 네이버 클로바팀 - 레고 블럭에 비유하여 누구나 이해할 수 있게 쉽게 설명해 놓은 이 책은 딥러닝의 입문 도서로서 제 역할을 다 하리라 믿습니다.
  • 김진중님, 야놀자 Head of STL - 복잡했던 머릿속이 맑고 깨끗해지는 효과가 있습니다.
  • 이태영님, 신한은행 디지털 전략부 AI LAB - 기존의 텐서플로우를 활용했던 분들에게 바라볼 수 있는 관점의 전환점을 줄 수 있는 Mild Stone과 같은 책이다.
  • 전태균님, 쎄트렉아이 - 케라스의 특징인 단순함, 확장성, 재사용성을 눈으로 쉽게 보여주기 위해 친절하게 정리된 내용이라 생각합니다.
  • 유재준님, 카이스트 - 바로 적용해보고 싶지만 어디부터 시작할지 모를 때 최선의 선택입니다.
^

케라스, 그 간결함에 빠지다


'개발 > Deep Learning' 카테고리의 다른 글

구글에서 데이터셋 검색  (0) 2019.07.08
keras 사용중 GPU sync failed?  (1) 2019.07.07
딥러닝 디버깅하기 tensor watch  (0) 2019.07.05
anaconda tensorflow gpu설치  (0) 2019.07.03
MNIST 동작 보기  (0) 2019.07.02
profile on loading

Loading...