Train calls the loss function as loss(d...)
if each datum d
is a tuple, i.e., with your definition of data
it is called as loss( (V_train, S_train)... ) = loss(V_train, S_train)
. On the other hand, your loss function is defined as taking input and target as arguments (in that order). Thus, your model learns to map V
to S
instead of the intended mapping. Flipping either the order of targets and inputs in your data set or in the arguments of the loss function will fix it.
2 Likes