python 数据编码器_如何在Keras中实现文本数据的一维共解自动编码器?

我有生物医学相关的文本数据,我想应用聚类。

这是我的代码

序列长度=58

ebbed U尺寸=50

我使用手套预先训练的词向量inputs = Input(shape=(SEQUENCE_LEN, EMBED_SIZE), name="input")

x = Conv1D(filters=NUM_FILTERS, kernel_size=NUM_WORDS,

activation="relu")(inputs)

x = MaxPooling1D(pool_size=pool_size)(x)

x = Conv1D(filters=12, kernel_size=NUM_WORDS,

activation="relu")(inputs)

x = MaxPooling1D(pool_size=pool_size)(x)

x = Conv1D(filters=8, kernel_size=NUM_WORDS,

activation="relu")(x)

encoded = MaxPooling1D(pool_size=pool_size)(x)

x = Conv1D(filters=12, kernel_size=NUM_WORDS,

activation="relu")(encoded)

x = UpSampling1D(size=pool_size)(x)

x = Conv1D(filters=16, kernel_size=NUM_WORDS,

activation="relu")(x)

x = UpSampling1D(size=pool_size)(x)

decoded = Conv1D(inputs, kernel_size=NUM_WORDS,

activation="sigmoid", data_format='channels_first')(x)

autoencoder = Model(inputs, decoded)

autoencoder.compile(optimizer="sgd", loss="mse")

当我运行这段代码时,我得到了这个错误

^{pr2}$

你可能感兴趣的:(python,数据编码器)