MimIR 0.1
MimIR is my 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 class | ad_eval_pass : flags_t |
%autodiff.ad_zero_pass | |
enum class | ad_zero_pass : flags_t |
%autodiff.ad_zero_cleanup_pass | |
enum class | ad_zero_cleanup_pass : flags_t |
%autodiff.ad_ext_cleanup_pass | |
enum class | 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 class | Tangent : flags_t |
const Def * | tangent_type_fun (const Def *) |
Ref | normalize_Tangent (Ref, Ref, Ref arg) |
%autodiff.AD | |
enum class | AD : flags_t |
enum class | 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 class | 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 class | add : flags_t |
Ref | normalize_add (Ref type, Ref callee, Ref arg) |
Currently resolved the full addition. | |
%autodiff.sum | |
enum class | sum : flags_t |
const Def * | op_sum (const Def *T, Defs) |
Ref | normalize_sum (Ref type, Ref callee, Ref arg) |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Definition at line 113 of file autodiff.cpp.
References autodiff_type_fun(), autodiff_type_fun_pi(), mim::match(), mim::Def::node_name(), mim::Idx::size(), and mim::Def::world().
Referenced by mim::plug::autodiff::AutoDiffEval::augment_(), mim::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(), mim::Pi::codom(), mim::Pi::dom(), mim::Pi::isa_cn(), and mim::Def::world().
Referenced by autodiff_type_fun(), and mim::plug::autodiff::AutoDiffEval::derive_().
Definition at line 32 of file autodiff.cpp.
References pullback_type(), and mim::Def::world().
Referenced by mim::plug::autodiff::AutoDiffEval::derive_().
Definition at line 18 of file normalizers.cpp.
References autodiff_type_fun(), and mim::Def::world().
Currently this normalizer does nothin.
TODO: Maybe we want to handle trivial lookup replacements here.
Definition at line 13 of file normalizers.cpp.
References mim::World::raw_app(), and mim::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 mim::plug::core::add, mim::Lit::as(), mim::match(), mim::Def::projs(), mim::Idx::size(), and mim::Def::world().
Definition at line 90 of file normalizers.cpp.
References mim::Def::projs(), and mim::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 mim::World::raw_app(), and mim::Def::world().
Definition at line 169 of file autodiff.cpp.
References mim::World::app(), and mim::Def::world().
Referenced by mim::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 mim::Def::world().
Referenced by mim::plug::autodiff::AutoDiffEval::augment_extract(), mim::plug::autodiff::AutoDiffEval::augment_lam(), mim::plug::autodiff::AutoDiffEval::augment_pack(), mim::plug::autodiff::AutoDiffEval::augment_tuple(), id_pullback(), and zero_pullback().
void mim::plug::autodiff::register_normalizers | ( | Normalizers & | normalizers | ) |
Referenced by mim_get_plugin().
Definition at line 57 of file autodiff.cpp.
Referenced by mim::plug::autodiff::AutoDiffEval::augment_pack(), mim::plug::autodiff::AutoDiffEval::augment_tuple(), normalize_Tangent(), pullback_type(), and zero_pullback().
Definition at line 140 of file autodiff.cpp.
References mim::Idx::size(), and mim::Def::world().
Referenced by mim::plug::autodiff::AutoDiffZero::rewrite().
Definition at line 44 of file autodiff.cpp.
References pullback_type(), tangent_type_fun(), and mim::Def::world().
Referenced by mim::plug::autodiff::AutoDiffEval::augment_lam(), mim::plug::autodiff::AutoDiffEval::augment_lit(), and mim::plug::autodiff::AutoDiffEval::derive_().