Categories
Misc

Defining loss when number of inputs is greater than number of outputs

I have trained a model which outputs multiple images (say 2) at
a time, and takes in multiple inputs (say 5) to do so. However my
loss (MSE) is supposed to apply to only 2 pairs made of 2 of the
input and output. Meaning I define my model as:

themodel = Model( [ip1,ip2,ip3,ip4,ip5], [op1,op2] ) themodel.compile( optimizer='Adam', loss=['mse','mse'] ) 

My model seems to train correctly, I just couldn’t find
confirmation in the docs (compile
method)
of how Tf takes care of which tensors to apply the loss
to. My assumption is that it applies the first loss to the first
ip-op pair, and so on till output tensors are available and nothing
is applied to remaining input tensors. Is this what is happening?
Also another silly question, does this mean for multiple output
models, loss has to be defined for all the outputs, and is not
related to the number of inputs?

submitted by /u/juggy94

[visit reddit]

[comments]

Leave a Reply

Your email address will not be published. Required fields are marked *