AbstractGPs.jl icon indicating copy to clipboard operation
AbstractGPs.jl copied to clipboard

rrule for MeanFunction types

Open theogf opened this issue 4 years ago • 5 comments

Without rrule AD will not pass for MeanFunction types. #16 resolves #14 for ZeroMean but it should be done for all types.

theogf avatar Jul 20 '20 14:07 theogf

Any chance of writing a macro for all mean functions, or defining an abstract mean function so that an abstract rrule can be defined?

yebai avatar Jul 20 '20 17:07 yebai

This wouldn't be viable as a general solution without calling back into an AD, which isn't something that is currently supported by ChainRules (you still have to use an AD-specific solution for that, although it's something that we're working on).

The right solution here is for us to fix https://github.com/FluxML/Zygote.jl/issues/646 so that this doesn't happen in the first place.

willtebbutt avatar Jul 20 '20 17:07 willtebbutt

@willtebbutt I think that the main issue still comes from using map everywhere (as it is the case for KernelFunctions). Should we consider doing the same thing as in KernelFunctions and temporarily replace it by the ersatz _map until the Zygote issue you mentionned is solved?

theogf avatar Jul 31 '20 12:07 theogf

Eurgh, yeah, you're probably right. This is very sad, but probably necessary for now.

willtebbutt avatar Jul 31 '20 12:07 willtebbutt

I'll make a PR

theogf avatar Jul 31 '20 12:07 theogf

This was resolved a while ago

willtebbutt avatar Sep 15 '23 19:09 willtebbutt