LSTM(long short term memory)
- 문맥을 파악해서 뒤에 오는 단어를 파악.
- LSTM은 RNN에 추가적으로 cell state라는 파이프 라인을 가짐.
- cell state 기능 : 이전 토큰과의 문맥 관련성을 유지하고 이미 언급된 것을 피함. bidrectional → 이후 문맥들은 이전 문맥에 영향을 끼친다.
- it detects how the combination of words in the input text determines the output class
- single layer LSTM - parts-of-speech tagging, music composition, language translation
🔜equations for the GRU(?)
🔜equations for LSTM(?)
https://www.coursera.org/lecture/nlp-sequence-models/long-short-term-memory-lstm-KXoay
LSTM code에서 구현하기
tf.keras.layers.bidirectional(tf.keras.layers.LSTM(FILTERS, return_sequences=<boolean>)
LSTM을 STACK으로 쌓을 수 있음.
그러면, 마지막 bidirectional이 아닌 bidirectional에 인수 return_sequencs=True
로 설정해야함.
C3_W3_Lab_1_single_layer_LSTM
imdb reviews subwords 데이터셋을 사용.
LSTM 레이어 1개 사용
- download imdb reviews subwords