简体   繁体   中英

Building a model in keras

I have tried to build my model in Keras. My model has 2 inputs and 2 outputs. The model includes 5 convolution layers and the weights of the layers must be shared. But, the new layers after the convolutional layers should not share the weights. I used concatenate() but it affected the other layers. The figure of my model is below the page. How can I do that?

The Network-Model:

截图网络模型

I think you should upload the image of model architecture again. And the part of shared weights confused me. I think you mean just one layer with one input.

input = Input(shape=(64,))

layer_1 = Dense(32, activation="relu")(input)

layer_2 = Dense(16, activation="relu")(layer_1)
layer_3 = Dense(16, activation="relu")(layer_1)

combined = concatenate([layer_2 , layer_3])

output = Dense(8, activation="relu")(combined)
output = Dense(1, activation="linear")(z)

model = Model(inputs=[input], outputs=output)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM