We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62905f1 commit 4912ed3Copy full SHA for 4912ed3
1 file changed
08 - RNN/02 - Autocomplete.py
@@ -4,7 +4,6 @@
4
import numpy as np
5
6
7
-# char_arr = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
8
char_arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g',
9
'h', 'i', 'j', 'k', 'l', 'm', 'n',
10
'o', 'p', 'q', 'r', 's', 't', 'u',
@@ -26,14 +25,14 @@ def make_batch(seq_data):
26
25
target_batch = []
27
28
for seq in seq_data:
29
- # 여기서 생성하는 x_data 와 y_data 는
30
- # 실제 숫자가 아니라 숫자 리스트의 인덱스 번호 입니다.
31
- # [0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5] ...
+ # 여기서 생성하는 input_batch 와 target_batch 는
+ # 알파벳 배열의 인덱스 번호 입니다.
+ # [22, 14, 17] [22, 14, 14] [3, 4, 4] [3, 8, 21] ...
32
input = [num_dic[n] for n in seq[:-1]]
33
- # 3, 4, 5, 6...10
+ # 3, 3, 15, 4, 3 ...
34
target = num_dic[seq[-1]]
35
# one-hot 인코딩을 합니다.
36
- # if x_data is [0, 1, 2]:
+ # if input is [0, 1, 2]:
37
# [[ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
38
# [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.]
39
# [ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0.]]
0 commit comments