title: How do you pass outputs of two different models as inputs to a another model in keras?
body: <p><a href="https://i.stack.imgur.com/7zLJn.jpg" rel="nofollow noreferrer">Here's the kind of model I want to make</a></p>
  
  <p>I'm trying to make a sort of adversarial network. I have already trained a discriminator. Now I want to connect outputs of two separate VGG16 models to this discriminator. I'm trying to avoid retraining the discriminator and just simply load pre-trained weights, that is why I want to load the model and then somehow connect it with the two VGG16 models. </p>
  
  <p>If there is a way I can load the weights for the discriminator part only somehow that would be great as well! </p>
  
  <p>Apologies if my query is not in line with the guidelines, this is my second every post on stackoverflow.</p>
  
  <p>EDIT: Here's the code I've written for the overall structure without loading weights, i.e. I will be training this from scratch.</p>
  
  <p>sat/street extractors are VGG16 networks that learn features</p>
  
  <pre><code>    sat_fv = sat_extractor.layers[-1].output
      str_fv = street_extractor.layers[-1].output
  
      deep_sat_feat = Reshape((32, 32, 1))(sat_fv)
      deep_street_feat = Reshape((32, 32, 1))(str_fv)
      deep_merged = concatenate([deep_sat_feat, deep_street_feat], axis=3)
  
      deep_act_1 = conv2d_block(deep_merged)
  
      flat = Flatten()(deep_act_1)
      dense = Dense(4096)(flat)
      act = LeakyReLU()(dense)
      dense = Dense(1024)(act)
      act = LeakyReLU()(dense)
      dense = Dense(128)(act)
      act = LeakyReLU()(dense)
  
      den_3 = Dense(1)(act)
      act_5 = Activation("sigmoid")(den_3)
  
      generator_model = Model(inputs=[sat_extractor.input,street_extractor.input], outputs=[sat_fv,str_fv,act_5])
      discriminator_model = Model(inputs=[sat_extractor.input,street_extractor.input], outputs=[act_5])
      generator_model.compile('Adam',loss=['categorical_crossentropy','categorical_crossentropy','binary_crossentropy'],loss_weights=[1/15,1/15,1/3])
      discriminator_model.compile(loss="binary_crossentropy", optimizer=Adam(0.00001), metrics=["accuracy"])
  </code></pre>