Hello, I have a question about differentiating the tet_materials array in self.model. Specifically, I am trying to write a script that can change the k_mu parameter. I set self.model = builder.finalize(requires_grad=True) and am able to view the gradients. However, the loss does not change which indicates the gradients are not being updated properly. The object function is defined by comparing the center of mass between the target and model states. Here is my gradient update kernel:
Hello, I have a question about differentiating the
tet_materials
array inself.model
. Specifically, I am trying to write a script that can change thek_mu
parameter. I setself.model = builder.finalize(requires_grad=True)
and am able to view the gradients. However, the loss does not change which indicates the gradients are not being updated properly. The object function is defined by comparing the center of mass between the target and model states. Here is my gradient update kernel:Here is the entire script. https://gist.github.com/rrzhang139/29f57c89f12813ec9b969a2f200bbe6d