-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
Summary
When I keep vertex positions buffer as optimization parameters, the loss is apparently being backpropogated incorrectly. Even if I keep the reference image and new image exactly the same, over a few iterations, the vertex positions keep getting updated and the loss keeps increasing.
System configuration
- Platform: Ubuntu 20.4
- Compiler: CMAKE 3.16.3
- Python version: 3.8.5
- Mitsuba 2 version: mitsuba-2
- Branch : pathreparam-optix7
- Compiled variants:
scalar_rgbgpu_autodiff_rgb
Description
Even if my source and target scene is exactly the same, if I keep the vertex positions buffer as differentiable parameter, the loss keep getting increased. Following is a sample of losses and corresponding images for the first 4 iterations from one example.
Reference Render:
Iteration 1 : (Loss = 4.21295e-16)

Iteration 2 : (Loss = 0.000416789)

Iteration 3 : (Loss = 0.0170517)

Following is my relevant code snippet :
scene = load_file('bagel/scene.xml')
image_ref = render(scene, spp=2)
params = traverse(scene)
params.keep(['object.vertex_positions_buf'])
opt = Adam(params, lr=.02)
for it in range(iterations):
image = render(scene, spp=2)
ob_val = ek.hsum(ek.sqr(image - image_ref)) / len(image)
ek.backward(ob_val)
opt.step()
Metadata
Metadata
Assignees
Labels
No labels