Closed jaroslavknotek closed 2 years ago
Hi @jaroslavknotek
I do not think that Mitsuba 2 can do this out of the box.
During the call to opt.step()
we update the ParameterMap
which triggers all necessary internal state re-computations. In your case, some spectral distribution needs to be recomputed. Right before that line, you could use ek.clamp
or whatever code you need to guarantee that your parameters are valid before updating the ParameterMap
.
Thank you
Summary
I have a scene with a chrome ball:
Using
gpu_autodiff_spectral
mode, I tried to optimize parameters:After following your tutorial here. I came up with this code:
The reference image
image_ref
is an external image loaded this way:Therefore I compare array of floats to array of floats both with values in the interval [0,1]. Before running the inverse rendering, I tried to render basic chrome ball, to see how it looks and it rendered just fine.
However, when I start the adam optimizer, it prints out this error + stacktrace:
I am using
Is it possible to limit the parameters space of ADAM optimizer so it wouldn't come up with nonsense values? I think that limiting the learning rate will help a bit but it won't prevent program from crashing. Therefore I consider this a bug.