code_5.py 386 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4 5 6 7
from keras.models import Sequential # 导入序贯模型
from keras.layers.embeddings import Embedding #导入词嵌入层
from keras.layers import Dense #导入全连接层
from keras.layers import Simple RNN #导入Simple RNN层
embedding_vecor_length = 60 # 设定词嵌入向量长度为60
rnn = Sequential() #序贯模型
rnn.add(Embedding(dictionary_size, embedding_vecor_length,