Hello,I am using a Unet network and need to write a loss function myself, this loss function needs to involve calculations that convert to numpy.
Summary
def my_mse_loss(input, target):
a = input.data[0].numpy().flatten()
b = target.data[0].numpy().flatten()
loss = 0
for i in range(len(a)):
x = a[i]-b[i]
loss += abs(x**2)
return torch.Tensor(loss) / input.data.nelement()
What kind of operations do you need from numpy that are not available in Pytorch?
It would make the implementation easier, if it’s possible to use pure Pytorch.