Skip to content

Parameters clipping in *Gradient-based optimization* tutorial prevents optimisation convergence to correct colour. #25

@KelSolaar

Description

@KelSolaar

In https://github.com/mitsuba-renderer/mitsuba-tutorials/blob/master/inverse_rendering/gradient_based_opt.ipynb

    # Post-process the optimized parameters to ensure legal color values.
    opt[key] = dr.clip(opt[key], 0.0, 1.0)

The clipping of the optimized parameters prevents convergence to correct colour:

original_color_r 0.5700680017471313
original_color_g 0.043013498187065125
original_color_b 0.04437059909105301
Image

With clipping:

color/optimisation/r 0.5676486492156982
color/optimisation/g 0
color/optimisation/b 0
Image Image

Without clipping

color/optimisation/r 0.5676485896110535
color/optimisation/g 0.04339996352791786
color/optimisation/b 0.041679296642541885
Image Image

Even though the optimiser makes negative excursions, it recovers nicely and converges to the expected result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions