I have a model like this:
img_rows = 32
img_cols = 32
img_channels = 3
img_input = Input(shape=(img_rows, img_cols, img_channels))
layer1 = Conv2D(16, (2, 2), padding='same', activation='relu')(img_input)
layer2 = Conv2D(16, (2, 2), padding='same', activation='relu')(layer1)
layer3 = MaxPooling2D((2, 2), strides=(2, 2), padding='same')(layer2)
layer4 = Flatten()(layer3)
laser_input = Input(shape=(100,))
merge_input = keras.layers.concatenate([layer4, laser_input])
layer5 = Dense(300, activation='relu')(merge_input)
layer6 = Dense(200, activation='relu')(layer5)
layer7 = Dense(100, activation='relu')(layer6)
output = Dense(21, activation='softmax')(layer7)
model = Model(inputs=[img_input, laser_input], outputs=output)
optimizer = optimizers.RMSprop(lr=learningRate, rho=0.9, epsilon=1e-06)
model.compile(loss="mse", optimizer=optimizer)
model.summary()
So as far as I understand, my model takes a list of two numpy arrays as input. Now I want to train this model on minibatch (of size 64) like this:
model.fit(X_batch, Y_batch, batch_size=64, ...)
How can I create X_batch, and what is the type of Xbatch? I think it is an array of lists, am I correct?
I've got a solution for this. I divided X_batch into X_image_batch and X_laser_batch then appended inputs to each sub-batches. Finally X_batch = [X_image_batch, X_laser_batch].