Open hyunsu-yang opened 3 years ago
# data setting
x_data = []
y_data = []
for i in range(0, len(sentence) - sequence_length): x_str = sentence[i:i + sequence_length] y_str = sentence[i + 1: i + sequence_length + 1] print(i, x_str, '->', y_str)
x_data.append([char_dic[c] for c in x_str]) # x str to index
y_data.append([char_dic[c] for c in y_str]) # y str to index
x_one_hot = [np.eye(dic_size)[x] for x in x_data]
#### 문제
long sequence의 if you want ~ 로 시작하는 예제의 매번 학습된 결과를 보면 if you want ~ 의 f가 f가 아닌 다른 문자로 나오는 경우가 더 많은데 그 이유는?
f가 나오도록 하려면 예제를 어떻게 바꿔볼 수 있을까?
sentence = ("?if you want, don't drum up people together to "
"collect wood and don't them tasks and work, but rather "
"teach them to long for the endless of the sea.")
=>
강의
목차