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

Backward mode differentiation #2

Open
8 tasks done
AraneusRota opened this issue May 19, 2021 · 0 comments
Open
8 tasks done

Backward mode differentiation #2

AraneusRota opened this issue May 19, 2021 · 0 comments

Comments

@AraneusRota
Copy link
Collaborator

AraneusRota commented May 19, 2021

  • CPS with manual continuation passing where all continuation build the forward pass and the code after the continuation are operations for the backward pass
  • functional CPS (no side-effects)
  • CPS where the user does not need to use continuation explicitly by using Monads and for-comprehensions
  • chainable monad implementation (functions can be chained)
  • Monads without for comprehensions by using macros
  • Tape (save all instructions which should be performand in the backward pass on a "tape")
  • functional tape (no side-effects)
  • CHAD-paper implementation (sum, mul, if, loop, val), no higher order differentiation

Machine learning tasks use backpropagation to learn with neural networks therefore backward mode differentiation must be supported.

Motivation:
Usually a neural network has many inputs but only a few outputs

Reverse accumulation is more efficient than forward accumulation for functions f : ℝ^n → ℝ^m with m ≪ n as only m sweeps are necessary, compared to n sweeps for forward accumulation.
https://en.wikipedia.org/wiki/Automatic_differentiation#Reverse_accumulation

Multiple implementation styles are tried out (see checklist on top). Dual numbers aren't an own category anymore because they are probably used in both styles because you often need access to the normal evaluation result and the derivative of a term which can be achieved by using dual numbers.

@AraneusRota AraneusRota changed the title Komplexe Ausdrücke differenzieren Backward mode differentiation Jun 3, 2021
AraneusRota added a commit that referenced this issue Jun 14, 2021
@AraneusRota AraneusRota changed the title Backward mode differentiation Runtime Backward mode differentiation Jun 17, 2021
@AraneusRota AraneusRota changed the title Runtime Backward mode differentiation Backward mode differentiation Jun 17, 2021
AraneusRota added a commit that referenced this issue Jul 22, 2021
…ns in function declarations which enables the user to write imperative code instead of passing the continuation manually
AraneusRota added a commit that referenced this issue Jul 26, 2021
…e of the derivation map (in '+'- and '*'-methods) ignoring the first update. This lead to wrong results if left and right hand sides are same (e.g. x * x)
AraneusRota added a commit that referenced this issue Jul 26, 2021
AraneusRota added a commit that referenced this issue Jul 26, 2021
… is given a unique id for the derivation map because you can't use the object you want to construct in a function you want to pass to its constructor
AraneusRota added a commit that referenced this issue Sep 29, 2021
…was added multiple times into the tape when a "node" was used at multiple places in a calculation
AraneusRota added a commit that referenced this issue Sep 29, 2021
…ix to mark a monad which will be rewritten into flatMap-chains. '_yield' marks end of forless expressions. Other statements are also allowed but sometimes lead to problems (infinite compiler loop when defining functions)
AraneusRota added a commit that referenced this issue Sep 29, 2021
…es multiplication where only one parameter is allowed (like in the intro of the paper)
AraneusRota added a commit that referenced this issue Sep 30, 2021
…low constructs and variables (val, var) possible)
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

1 participant