title: How to feed a Neural Network with two inputs of different sizes?
body: <p>I want to feed a Neural Network with two inputs. 
  The first dataset (elements) will have a fixed shape of (20, 1), which means that it will be the same for both the training and the test phase (it will never change). It consists of values between 1-100.
  The second input dataset will consist of 20 binary features (columns) and N data (shape: (N,20)), and each row of this dataset will indicate which rows of the elements dataset were combined.
  The output will have a shape of (N,1), and it will be the result of the corresponding elements' combinations, after applying a specific function to them.</p>
  
  <p>I know how to build a model with multiple inputs when we have the same number of rows in both datasets, and my approach so far is the following:</p>
  
  <pre><code># define two sets of inputs
  inputA = Input(shape=(1,))
  inputB = Input(shape=(elements.shape[0],))
  
  # the first branch operates on the first input
  x = Dense(100, activation="relu")(inputA)
  x = Dense(50, activation="relu")(x)
  x = Model(inputs=inputA, outputs=x)
  
  # the second branch opreates on the second input
  y = Dense(100, activation="relu")(inputB)
  y = Dense(100, activation="relu")(y)
  y = Dense(50, activation="relu")(y)
  y = Model(inputs=inputB, outputs=y)
  
  # combine the output of the two branches
  combined = concatenate([x.output, y.output])
  
  # apply a FC layer and then a regression prediction on the
  # combined outputs
  z = Dense(50, activation="relu")(combined)
  z = Dense(1, activation="linear")(z)
  
  # our model will accept the inputs of the two branches and
  # then output a single value
  model = Model(inputs=[x.input, y.input], outputs=z)
  
  model.compile(loss="mean_squared_error", optimizer=Adam())
  
  # train the model
  print("[INFO] training model...")
  model.fit([elements, X_train], y_train, epochs=200, verbose=1)
  </code></pre>
  
  <p>However, since the "elements" dataset is fixed, the rows of the 1st input are different from the rows of the 2nd input. The following error occurs.</p>
  
  <pre><code>ValueError: All input arrays (x) should have the same number of samples. Got array shapes: [(20, 1), (33, 20)]
  </code></pre>
  
  <p>Do you know how could I overcome this problem?</p>