def multi_inputs_multi_outputs_model():
    input_a = keras.layers.Input(shape=(16,), name='input_a')
    input_b = keras.layers.Input(shape=(16,), name='input_b')
    input_m = keras.layers.Input(shape=(8,), dtype='string', name='input_m')
    dense = keras.layers.Dense(8, name='dense_1')
    interm_a = dense(input_a)
    interm_m = keras.layers.Lambda(gen_parsing_ops.string_to_number)(input_m)
    interm_s = keras.layers.Lambda((lambda k: (k[0] * k[1])))([interm_m, interm_a])
    interm_b = dense(input_b)
    merged = keras.layers.concatenate([interm_s, interm_b], name='merge')
    output_c = keras.layers.Dense(3, activation='softmax', name='dense_2')(merged)
    output_d = keras.layers.Dense(2, activation='softmax', name='dense_3')(merged)
    model = keras.models.Model(inputs=[input_a, input_b, input_m], outputs=[output_c, output_d])
    model.compile(loss='categorical_crossentropy', optimizer=gradient_descent.GradientDescentOptimizer(0.001), metrics={'dense_2': 'categorical_accuracy', 'dense_3': 'categorical_accuracy'})
    return model
def multi_inputs_multi_outputs_model():
    input_a = keras.layers.Input(shape=(16,), name='input_a')
    input_b = keras.layers.Input(shape=(16,), name='input_b')
    input_m = keras.layers.Input(shape=(8,), dtype='string', name='input_m')
    dense = keras.layers.Dense(8, name='dense_1')
    interm_a = dense(input_a)
    interm_m = keras.layers.Lambda(gen_parsing_ops.string_to_number)(input_m)
    interm_s = keras.layers.Lambda((lambda k: (k[0] * k[1])))([interm_m, interm_a])
    interm_b = dense(input_b)
    merged = keras.layers.concatenate([interm_s, interm_b], name='merge')
    output_c = keras.layers.Dense(3, activation='softmax', name='dense_2')(merged)
    output_d = keras.layers.Dense(2, activation='softmax', name='dense_3')(merged)
    model = keras.models.Model(inputs=[input_a, input_b, input_m], outputs=[output_c, output_d])
    model.compile(loss='categorical_crossentropy', optimizer=gradient_descent.GradientDescentOptimizer(0.001), metrics={'dense_2': 'categorical_accuracy', 'dense_3': 'categorical_accuracy'})
    return model