로딩
요청 처리 중입니다...

RNN_문자단위

 RNN_문자단위

import torch import torch.nn as nn import torch.optim as optim import numpy as np sentence = ("if you want to build a ship, don't drum up people together to " "collect wood and don't assign them tasks and work, but rather " "teach them to long for the endless immensity of the sea.") char_set = list(set(sentence)) # 중복을 제거한 문자 집합 생성 char_dic = {c: i for i, c in enumerate(char_set)} # 각 문자에 정수 인코딩 print(char_dic) # 공백도 여기서는 하나의 원소 dic_size = len(char_dic) print('문자 집합의 크기 : {}'.format(dic_size)) #...

원문 링크 : RNN_문자단위