Open
Description
As suggested in #90 (comment) , we might want to consider moving away from to_vec
towards defining operations on ChainRules
's types directly.
In particular #91 implements the difference
operation, which is the only operation that we're missing to let us approximately compute tangents. Still TODO is
- determine how to compute cotangents within this framework + implement it, and
- determine whether or not we require some notion of a Jacobian (probably we do) and implement it, and
- define the norm of a differential, from which we get
isapprox
for free if we also define subtraction, which is really easy because we've already defined addition and scalar multiplication. I think we can do this because I think we can always derive an appropriate norm for a differential, that is, I think we can treat any given differential as being an element of an appropriate normed vector space. (Note that we've not defined inner products between differentials, and I don't think we need to. Doing so would be one way to go about defining a norm, but it probably makes sense to go straight to a norm if we can't think of a reason why would need to define inner products. I'm open to suggestions here.) This is something we'll need to sort out inChainRulesCore
, as per Approximate Equality of Differentials ChainRulesCore.jl#184.
Implementing this will immediately resolve:
- j′vp errors on empty array primal input #92
- Overload
FiniteDifferences.to_vec
for Composite ChainRulesTestUtils.jl#24 as it is covered bydifference
already
but will generally significantly improve the compatibility between ChainRules
s and FiniteDifferences
, and should make one's experience testing differentials a much more pleasant experience.
Metadata
Metadata
Assignees
Labels
No labels