Right now the package falls back to Zygote for computing gradients using automatic differentiation. It would be nice to add support for multiple AD backends (ReverseDiff, Enzyme, Yota, Nabla, Diffractor… anything that works) so that one can chose what should be used.
This would require a mechanism for “optional dependencies”, so that a certain backend can be used only if the required dependency is installed.
Two ways I see for selecting what backend to use:
- Some global variable
- Wrapping functions in a specific type that enforces using this or that AD backend, eg,
ZygoteFunction(f), ReverseDiffFunction(f), …
Right now the package falls back to Zygote for computing gradients using automatic differentiation. It would be nice to add support for multiple AD backends (ReverseDiff, Enzyme, Yota, Nabla, Diffractor… anything that works) so that one can chose what should be used.
This would require a mechanism for “optional dependencies”, so that a certain backend can be used only if the required dependency is installed.
Two ways I see for selecting what backend to use:
ZygoteFunction(f),ReverseDiffFunction(f), …