[#E21] Recurrent Neural Network (RNN - PART 3/3)
이전의 "hi hello" 문자열이나 LONG SEQUENCE RNN에서 사용했던 긴 문자열과는 달리, 사용자로부터 직접 데이터(문자열)을 입력받는 것을 DYNAMIC RNN이라고 합니다. 이것은 데이터에 이미 정해진 문자열 길이가 아닌 가변적인 문자열 길이를 사용한다는 의미입니다. 예로 3개의 문자열 'hello', 'eolll', 'lleel'이 있다고 가정합니다. 12345678910111213import tensorflow as tfimport numpy as npimport pprintpp = pprint.PrettyPrinter(indent=4)sess = tf.InteractiveSession() h = [1, 0, 0, 0]e = [0, 1, 0, 0]l = [0, 0, 1, 0]o = [..
[#E17] Convolution Neural Network (CNN - 실전편)
이번에는 실제로 텐서플로우에서 Convolution 데이터와 Pooling이 어떻게 진행되는지에 대해 알아보겠습니다. 먼저 다음과 같이 예시 이미지를 생성합니다. 123456789101112import numpy as npimport tensorflow as tfimport matplotlib.pyplot as plt sess = tf.InteractiveSession()image = np.array([[[[1],[2],[3]], [[4],[5],[6]], [[7],[8],[9]]]], dtype=np.float32)print(image.shape) #-> (1, 3, 3, 1) #show imageplt.imshow(image.reshape(3,3), cmap='Greys')cs 해당 이미지는 왼쪽 상..