摘要:
from keras.layers import Dense, Input from keras.layers import Conv2D, Flatten from keras.layers import Reshape, Conv2DTranspose from keras.models imp 阅读全文
摘要:
from keras.layers import LSTM model = Sequential() model.add(embedding_layer) model.add(LSTM(32)) #当结果是输出多个分类的概率时,用softmax激活函数,它将为30个分类提供不同的可能性概率值 mod 阅读全文
摘要:
import matplotlib.pyplot as plt import numpy as np import matplotlib.mlab as mlab import math mu = 0 variance = 1 sigma = math.sqrt(variance) x = np.l 阅读全文
摘要:
import numpy as np samples = ['The cat jump over the dog', 'The dog ate my homework'] #我们先将每个单词放置到一个哈希表中 token_index = {} for sample in samples: #将一个句 阅读全文