I would like to implement a SSIM loss function, since the boarders are aborted by the convolution, I would like to preserve the boarders and compute L1 loss for the pixels of boarder. The code are learned from here. SSIM / MS-SSIM for TensorFlow
For example, we hava img1 and img2 size [batch,32,32,32,1], and the window_size of Guassian 11, the result ssim map will be [batch,22,22,22,1], L1 map [batch,32,32,32,1] how can I assign ssim to the center of the L1?
I receive error like this; TypeError: 'Tensor' object does not support item assignment
For value-wise assignement, give a look at the answer here: Adjust Single Value within Tensor -- TensorFlow
A way that probably goes more along to what you are looking for might be:
tf.concat
operations to put the pieces together and have your final tensorFor example, I haven't checked if it works, but somethink like this should do the job: