Thorin 1.9.0
The Higher ORder INtermediate representation
|
The automatic differentiation Plugin More...
Classes | |
class | AutoDiffEval |
This pass is the heart of AD. More... | |
class | AutoDiffZero |
Replaces calls to the zero axioms with actual zeros. More... | |
class | AutoDiffZeroCleanup |
Replaces remaining zeros (not resolvable) with ⊥. More... | |
Enumerations | |
%autodiff.ad_eval_pass | |
enum | ad_eval_pass : flags_t |
%autodiff.ad_zero_pass | |
enum | ad_zero_pass : flags_t |
%autodiff.ad_zero_cleanup_pass | |
enum | ad_zero_cleanup_pass : flags_t |
%autodiff.ad_ext_cleanup_pass | |
enum | ad_ext_cleanup_pass : flags_t |
Functions | |
void | register_normalizers (Normalizers &normalizers) |
Helpers | |
const Pi * | pullback_type (const Def *E, const Def *A) |
computes pb type E* -> A* E - type of the expression (return type for a function) A - type of the argument (point of orientation resp. | |
const Def * | id_pullback (const Def *) |
const Pi * | autodiff_type_fun_pi (const Pi *) |
const Def * | autodiff_type_fun (const Def *) |
Variables | |
static constexpr plugin_t | Plugin_Id = 0x9655014a1c70000 |
%autodiff.Tangent | |
enum | Tangent : flags_t |
const Def * | tangent_type_fun (const Def *) |
Ref | normalize_Tangent (Ref, Ref, Ref arg) |
%autodiff.AD | |
enum | AD : flags_t |
enum | ad : flags_t |
Ref | normalize_ad (Ref type, Ref callee, Ref arg) |
Currently this normalizer does nothin. | |
Ref | normalize_AD (Ref type, Ref callee, Ref arg) |
%autodiff.zero | |
enum | zero : flags_t |
const Def * | zero_def (const Def *T) |
const Def * | zero_pullback (const Def *E, const Def *A) |
Ref | normalize_zero (Ref type, Ref callee, Ref arg) |
Currently this normalizer does nothing. | |
%autodiff.add | |
enum | add : flags_t |
Ref | normalize_add (Ref type, Ref callee, Ref arg) |
Currently resolved the full addition. | |
%autodiff.sum | |
enum | sum : flags_t |
const Def * | op_sum (const Def *T, Defs) |
Ref | normalize_sum (Ref type, Ref callee, Ref arg) |
Definition at line 113 of file autodiff.cpp.
References autodiff_type_fun(), autodiff_type_fun_pi(), thorin::Def::node_name(), thorin::Idx::size(), and thorin::Def::world().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_(), thorin::plug::autodiff::AutoDiffEval::augment_lam(), autodiff_type_fun(), autodiff_type_fun_pi(), and normalize_AD().
Definition at line 90 of file autodiff.cpp.
References autodiff_type_fun(), thorin::Pi::codom(), thorin::Pi::dom(), thorin::Pi::isa_cn(), and thorin::Def::world().
Referenced by autodiff_type_fun(), and thorin::plug::autodiff::AutoDiffEval::derive_().
Definition at line 32 of file autodiff.cpp.
References pullback_type(), and thorin::Def::world().
Referenced by thorin::plug::autodiff::AutoDiffEval::derive_().
Currently this normalizer does nothin.
TODO: Maybe we want to handle trivial lookup replacements here.
Definition at line 13 of file normalizers.cpp.
References thorin::World::raw_app(), and thorin::Def::world().
Definition at line 18 of file normalizers.cpp.
References autodiff_type_fun(), and thorin::Def::world().
Currently resolved the full addition.
There is no benefit in keeping additions around longer than necessary.
Definition at line 37 of file normalizers.cpp.
References thorin::plug::core::add, thorin::Lit::as(), thorin::Def::projs(), thorin::Idx::size(), and thorin::Def::world().
Definition at line 90 of file normalizers.cpp.
References thorin::Def::projs(), and thorin::Def::world().
Definition at line 25 of file normalizers.cpp.
References tangent_type_fun().
Currently this normalizer does nothing.
We usually want to keep zeros as long as possible to avoid unnecessary allocations. A high-level addition with zero can be shortened directly.
Definition at line 30 of file normalizers.cpp.
References thorin::World::raw_app(), and thorin::Def::world().
Definition at line 169 of file autodiff.cpp.
References thorin::World::app(), and thorin::Def::world().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_tuple().
computes pb type E* -> A*
E
- type of the expression (return type for a function) A
- type of the argument (point of orientation resp.
derivative - argument type for partial pullbacks)
Definition at line 62 of file autodiff.cpp.
References tangent_type_fun(), and thorin::Def::world().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_extract(), thorin::plug::autodiff::AutoDiffEval::augment_lam(), thorin::plug::autodiff::AutoDiffEval::augment_pack(), thorin::plug::autodiff::AutoDiffEval::augment_tuple(), id_pullback(), and zero_pullback().
void thorin::plug::autodiff::register_normalizers | ( | Normalizers & | normalizers | ) |
Referenced by thorin_get_plugin().
Definition at line 57 of file autodiff.cpp.
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_pack(), thorin::plug::autodiff::AutoDiffEval::augment_tuple(), normalize_Tangent(), pullback_type(), and zero_pullback().
Definition at line 140 of file autodiff.cpp.
References thorin::Def::node_name(), thorin::Idx::size(), and thorin::Def::world().
Referenced by thorin::plug::autodiff::AutoDiffZero::rewrite().
Definition at line 44 of file autodiff.cpp.
References pullback_type(), tangent_type_fun(), and thorin::Def::world().
Referenced by thorin::plug::autodiff::AutoDiffEval::augment_lam(), thorin::plug::autodiff::AutoDiffEval::augment_lit(), and thorin::plug::autodiff::AutoDiffEval::derive_().