0

I have a Keras deep learning model that outputs 6 variables.

model = Sequential()
model.add(Dense(32, input_dim=12, kernel_initializer='he_uniform', activation='relu'))
model.add(Dense(256, activation='relu'))
model.add(Dense(32, activation='relu'))
model.add(Dense(6, activation = 'linear'))
model.compile(loss = 'MSE', optimizer = 'adam')

How are the errors for these six variables compiled into one MSE? Should there not be an MSE for each of the six variables? Is it scaling the 6 and averaging them?

1 Answers1

0

It depends on the connection between these 6 variables. For example, the 6 variables is the same task that is onlt different depth of the network/model. You can scale the 6 and averaging them.

you should use six different loss function if the six variables is different task. Usually the weight of each loss function is equal.

I am a non-native English speaker. Hope you can understand my answer and help you.

Mason Ma
  • 41
  • 4
  • Thank you so much for answering. Yes, i understand. I'll need to research how to do that. But i founda workaround by just defining my own loss function. Thank you! – Glen Hamblin Mar 06 '22 at 17:06
  • @GlenHamblin could you please share how did you resolve this issue? Thanks – zaw ish Apr 06 '23 at 00:29