I would want to know if there's any possibility of having a loss function that looks like this:
This is used in a siamese network for metric learning. There are 2 identical networks with the same weights, where the Xs are the inputs and Y are the outputs. The thing is that the operations performed on the dlarrays are not permitted so the gradients cannot be computed.
Is there an alternative way to make this work?
function loss = lossfunc(Y1,Y2,X1,X2,dist)
loss = .5*((X1-X2)'*pinv(Y1*Y1')*(X1-X2)...