Skip to content

Commit 4912ed3

Browse files
committed
RNN 예제 설명 수정
1 parent 62905f1 commit 4912ed3

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

08 - RNN/02 - Autocomplete.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy as np
55

66

7-
# char_arr = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
87
char_arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g',
98
'h', 'i', 'j', 'k', 'l', 'm', 'n',
109
'o', 'p', 'q', 'r', 's', 't', 'u',
@@ -26,14 +25,14 @@ def make_batch(seq_data):
2625
target_batch = []
2726

2827
for seq in seq_data:
29-
# 여기서 생성하는 x_datay_data
30-
# 실제 숫자가 아니라 숫자 리스트의 인덱스 번호 입니다.
31-
# [0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5] ...
28+
# 여기서 생성하는 input_batchtarget_batch
29+
# 알파벳 배열의 인덱스 번호 입니다.
30+
# [22, 14, 17] [22, 14, 14] [3, 4, 4] [3, 8, 21] ...
3231
input = [num_dic[n] for n in seq[:-1]]
33-
# 3, 4, 5, 6...10
32+
# 3, 3, 15, 4, 3 ...
3433
target = num_dic[seq[-1]]
3534
# one-hot 인코딩을 합니다.
36-
# if x_data is [0, 1, 2]:
35+
# if input is [0, 1, 2]:
3736
# [[ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
3837
# [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.]
3938
# [ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0.]]

0 commit comments

Comments
 (0)