下面是一个简单的多输入多输出机器学习模型的 Python 代码示例:
from keras.layers import Input, Dense
from keras.models import Model# 多输入模型
input1 = Input(shape=(10,))
input2 = Input(shape=(10,))
# 共享层
shared_layer = Dense(8, activation='relu')
x1 = shared_layer(input1)
x2 = shared_layer(input2)
# 独立层
x1 = Dense(4, act