Solo
Solo

Reputation: 1

How to model hidden layer with two emanating output to another two hidden layers?

How do I model a hidden layer in Keras to output two outputs to be connected to two different hidden layers?

Input=x,
1st Hidden Layer(X),
2nd Hidden Layer(1st Hidden Layer),
3rd Hidden Layer (1st Hidden Layer)  # "also connected to 1st Hidden Layer instead of 2nd Hidden Layer"

Upvotes: 0

Views: 46

Answers (1)

today
today

Reputation: 33410

You can simply use the Keras Functional API for this purpose. For example you can write:

inp = Input(shape=...)
h1 = Dense(...)(inp)
h2 = Dense(...)(h1)
h3 = Dense(...)(h1)   # it is connected to first hidden layer

I highly recommend you to read the linked guide.

Upvotes: 1

Related Questions