Skip to content
Discussion options

You must be logged in to vote

Hi @pixelsandpointers

The piece of code that enables the gradient tracking here is the optimizer and not the scene parameters.

In your first snippet of code, opt['trans'] = mi.Point2f(0.2, -0.2) implicitly enables gradient tracking on opt['trans']. After that, there we define trafo = mi.Transform4f.translate([opt["trans"].x, opt["trans"].y, 0.0]) so trafo is also tracked as it depends on opt['trans'].
Finally, with the same logic, the params["your_key"] is also tracked.

In your second snippet of code, there is no optimizer to implicitly turn on gradient tracking, hence why you need to do it explicitly.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pixelsandpointers
Comment options

Answer selected by pixelsandpointers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants