Replies: 2 comments
-
Maybe @zjwegert has some comments. I suggest you check out GridapTopOpt, but yeah we do support AD using |
Beta Was this translation helpful? Give feedback.
-
Hi @bmdaj, I suspect you want to automate the above, and we do this in GridapTopOpt (see ChainRules.jl in src) by implementing different types of structures that compute the adjoint problem/s. Zygote support is a little more complicated as it requires that you've defined your rrule (as we have done in GridapTopOpt) in a "nice" way. Essentially, Zygote needs to know how to formulate the adjoint problem. This is something we're planning on fully supporting in GridapTopOpt in future as it will generalise much of the API. Currently, I believe this is somewhat supported in serial but it is still quite dev due to problems with caching. You could try using the state maps from GridapTopOpt for computing the adjoint problem. Alternatively, if you're willing, you could formulate the problem via a level-set method and use GridapTopOpt. @ConnorMallon has been looking GridapTopOpt-Zygote compat recently as well. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to set up an electromagnetic topology optimization code by following Tutorial 19. I am wondering if it is possible to use automatic differentiation (e.g. via Zygote) to automatically compute the gradient of a custom cost-function with respect to the solution field (H field) and then back-propagate with the rest of analytically calculated gradients. Is this something that Gridap supports?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions