"Keras:LSTM"의 두 판 사이의 차이
둘러보기로 가기
검색하러 가기
(→설계) 태그: 모바일 웹 편집 모바일 편집 |
(→개요) |
||
14번째 줄: | 14번째 줄: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | === input_shape === | ||
+ | 인풋 형태는 (타임스템프, feature) 형태이다. | ||
[[분류:Keras]] | [[분류:Keras]] | ||
[[분류:LSTM]] | [[분류:LSTM]] |
2021년 12월 2일 (목) 16:59 판
1 개요
케라스로 LSTM 구현해보기.
2 설계
from keras.models import Sequential
model = Sequential()
# 필요한 층을 더한다.
model.add(LSTM(50, return_sequences=True, input_shape=(50,1))) # 50개 유닛을 갖는 LSTM층 생성. 일반적으로 50개의 입력이 들어간다.
# input_shape에서 50개를 넣어 1개를 반환받는다는 의미인듯..? 일반적으로 timestamp,feature이라는데..
model.add(Dense(1, activation='linear')) # 일반 뉴런층 1개. 결과가 1개가 나온다.
model.compile(loss='mse', optimizer='rmsprop') # 손실함수 따위를 결정한다.
2.1 input_shape
인풋 형태는 (타임스템프, feature) 형태이다.