Keras regression multiple outputs

Viewed 5820

a question concerning keras regression with multiple outputs:

Could you explain the difference beteween this net:

two inputs -> two outputs

input = Input(shape=(2,), name='bla')
hidden = Dense(hidden, activation='tanh', name='bla')(input)
output = Dense(2, activation='tanh', name='bla')(hidden)

and: two single inputs -> two single outputs:

input = Input(shape=(2,), name='speed_input')
hidden = Dense(hidden_dim, activation='tanh', name='hidden')(input)
output = Dense(1, activation='tanh', name='bla')(hidden)

input_2 = Input(shape=(1,), name='angle_input')
hidden_2 = Dense(hidden_dim, activation='tanh', name='hidden')(input_2)
output_2 = Dense(1, activation='tanh', name='bla')(hidden_2)

model = Model(inputs=[speed_input, angle_input], outputs=[speed_output, angle_output])

They behave very similar. Other when I completly seperate them, then the two nets behave like they re supposed to.

And is it normal that two single output nets behave much more intelligible than a bigger one with two outputs, I didnt think the difference could be huge like I experienced.

Thanks a lot :)

1 Answers
Related