You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I was wondering if there is a way to take k-gradient steps with a jax.fori_loop. I can do it with a for loop, but as k can be large, I wanted to embed it with a fori_loop. Below is an example of what I have tried but was not able to get it to work. I get a Cannot mutate OptArray from a different trace level with a link to TraceContextError, but I couldn't find anything helpful.
Also, if I have two variables in my model and I want to optimize them separately, how do I go about that? For example: here I have self.W and a separate optimizer for it called w_optim, and I tried using filters to ensure they acted on the correct variables, but as soon as I uncomment them, I get Mismatch custom node data: ('A', 'W') != ('A',) while updating the gradients.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I was wondering if there is a way to take k-gradient steps with a
jax.fori_loop. I can do it with aforloop, but as k can be large, I wanted to embed it with afori_loop. Below is an example of what I have tried but was not able to get it to work. I get aCannot mutate OptArray from a different trace levelwith a link toTraceContextError, but I couldn't find anything helpful.Also, if I have two variables in my model and I want to optimize them separately, how do I go about that? For example: here I have
self.Wand a separate optimizer for it calledw_optim, and I tried using filters to ensure they acted on the correct variables, but as soon as I uncomment them, I getMismatch custom node data: ('A', 'W') != ('A',)while updating the gradients.I am not sure what is it that I am doing wrong. Any help will be greatly appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions