Hi. I've been reading your paper 'S3IM: Stochastic Structural SIMilarity and Its Unreasonable Effectiveness for Neural Fields'. It's a great work! However, I have some questions about S3IM.
def batch_indices_generator(N, BS):
# torch.randperm on cuda produce incorrect results in my machine
idx, top = torch.LongTensor(np.random.permutation(N)), 0
while True:
if top + BS > N:
idx, top = torch.LongTensor(np.random.permutation(N)), 0
yield idx[top:top+BS]
top += BS
...
index_generator = dvgo.batch_indices_generator(len(rgb_tr), cfg_train.N_rand)
batch_index_sampler = lambda: next(index_generator)
...
# random sample rays
if cfg_train.ray_sampler in ['flatten', 'in_maskcache']:
sel_i = batch_index_sampler()
target = rgb_tr[sel_i]
rays_o = rays_o_tr[sel_i]
rays_d = rays_d_tr[sel_i]
viewdirs = viewdirs_tr[sel_i]
This is fine when applying S3IM loss on them since S3IM will randomly permute them again. But I wonder how did you apply SSIM loss on it. Since the rays sampled are randomly generated, how does SSIM loss penalize them? If it just penalizes those rays without any processing, won't it make SSIM behave just like S3IM(since rendered pixels are shuffled)?
I try my best but can't figure out how it works. I hope you can shed some light on me, that will be very helpful!