Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Differentials more Numbery #37

Open
oxinabox opened this issue Aug 30, 2019 · 4 comments
Open

Make Differentials more Numbery #37

oxinabox opened this issue Aug 30, 2019 · 4 comments

Comments

@oxinabox
Copy link
Member

See #35 (comment)
and JuliaDiff/ChainRules.jl#55 (comment)

Things to consider:

  • Subtype Number
  • define iszero
  • define -
  • define /
  • define convert/promote using extern
  • boardcasting ? Like scalar?

I don't know that we should do all of them but with considering.
I don't particular like the idea of things implictly calling extern
But maybe it is ok.

@tkf
Copy link

tkf commented Sep 11, 2019

Looking at AbstractDifferential subtypes, I got an impression that a lot of machinery can be replaced with LazyArrays.jl. One advantage for using LazyArrays.jl may be that it can optimize computation across multiple pullbacks. For example, the pullback for x -> x + A * x could use gemm! etc. by fusing + and *. Do you think it make sense to use LazyArrays.jl here?

(I wish there are BLAS-like kernels with diagonal β. We could then use it for ResNet-like layer...)

@oxinabox
Copy link
Member Author

maybe.
I've not used LazyArrays before.
it is worth looking into.
I will report back

@nickrobinson251
Copy link
Contributor

related discussion in FluxML/Zygote.jl#603

@oxinabox
Copy link
Member Author

My latest thoughts in particular is the operations it makes sense to define on differentials are linear operators.

Conceptually, a differential being a vector spacish type.
(if one really wants to weaken it, it is an additive groupish type but I like my scaling)
so there really should be a common super-type of Number, AbstractArray, and AbstractDifferential.
And we should define the things that are require for that.
But not the things that make arrays and number distrinct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants