我有以下形式的多输出网络(是的,代码主要来自中等文章:https://medium.com/analytics-vidhya/implementing-a-gan-in-keras-d6c36bc6ab5f)
input = Input(shape=(100,50),dtype='float32')
drop_1 = Dropout(0.3,name='drop_1')(input)
dense_1 = Dense(20,activation='relu')(drop_1)
dense_2 = Dense(2)(dense_1)
flatten_1 = Flatten()(dense_2)
preds = Dense(7,activation='softmax')(flatten_1)
generator = Model(sequence_input, outputs=[preds,dense_2])
generator.compile(loss=['categorical_crossentropy',None],
optimizer='adam',
metrics=['acc'])
现在,我想在另一个网络中使用输出(我正在尝试构建GAN),因此需要使用第二个输出,如下所示:
gan_input = Input(shape=(100,50),dtype='float32')
fake = generator(gan_input)
gan_output = discriminator(fake[1])
我怎么指称它? fake [1]似乎不起作用,它导致以下错误:
TypeError: unsupported callable
非常感谢您!