Here are my inputs (left), the inference from the model (middle) and the response I was waiting (right).
As you can see the shape is quite good, but the intensity is slightly off by 10-20% compared to the target image.
Yes I checked the source, inference and targets multiple times.
FYI I don’t do any normalization steps, but the values are always between 0 and 1.
Here’s my UNet code: (pytorch c++): https://github.com/divideconcept/PyTorch-libtorch-U-Net/blob/master/unet.h
My training loop is as follow (pytorch c++) :
optim.zero_grad();
result = model->forward(source[b]);
loss = torch::mse_loss(result, target[b]);
loss.backward();
optim.step();