我正在使用Keras深度自动编码器来重现我的稀疏[360, 6860]
维度矩阵.每行是蛋白质序列的三卦计数.矩阵有两类蛋白质,但我希望网络最初不知道,这就是我使用自动编码器的原因.我正在关注keras博客autoencoder教程.
这是我的代码 -
# this is the size of our encoded representations
encoding_dim = 32
input_img = Input(shape=(6860,))
encoded = Dense(128, activation='relu', activity_regularizer=regularizers.activity_l1(10e-5))(input_img)
encoded = Dense(64, activation='relu')(encoded)
encoded = Dense(32, activation='relu')(encoded)
decoded = Dense(64, activation='relu')(encoded)
decoded = Dense(128, activation='relu')(decoded)
decoded = Dense(6860, activation='sigmoid')(decoded)
autoencoder = Model(input=input_img, output=decoded)
# this model maps an input to its encoded representation
encoder = Model(input=input_img, output=encoded)
# create a placeholder for an encoded (32-dimensional) input
encoded_input_1 = Input(shape=(32,))
encoded_input_2 = Input(shape=(64,))
encoded_input_3 …
Run Code Online (Sandbox Code Playgroud)