Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (29 sloc) 1.606 kB
5127dc7 @ekmett TODO
authored
1 * Use the f-branching stream and tensors to generate:
2
3 gradients :: Traversable f => FU f a -> f a -> Stream f a
4
4e83a16 @ekmett repository initialized. multiple modes of automatic differentiation c…
authored
5 * Allow the type to vary within our AD data type container, in the same fashion as Numeric.FAD.
6
927ffc2 @ekmett TODO
authored
7 Although, while Pearlmutter and Siskind provided the functionality to permit
8 it in the derivative combinators, they provided no combinators to convert,
9 say, @Dual tag Float@ to a @Dual tag Double@, so that extra functionality cannot
4e83a16 @ekmett repository initialized. multiple modes of automatic differentiation c…
authored
10 currently be leveraged.
11
927ffc2 @ekmett TODO
authored
12 One approach: GADT'd Tape.
13 Lets us use local matrix-valued jacobians as blackboxes.
14 However, this requires a custom higher-order data-reify.
15
5127dc7 @ekmett TODO
authored
16 * Do we need some kind of Array implementation? These'd be easy:
927ffc2 @ekmett TODO
authored
17
18 (new)?type ADArray s i e = Array i (AD s e)
19 (new)?type ADIOArray s i e = IOArray i (AD s e)
20 (new)?type ADSTArray s i e = STArray i (AD s e)
21
22 But how to handle possibly unboxed arrays where possible?
23
24 Mode s => ADUArray s i Float
25 Mode s => ADIOUArray s i Float
26 Mode s => ADSTUArray s i Float
27
28 Forward admits fast unboxed array access, but how to avoid violating quantification over s?
29
30 This seems to require baking the array type for Float and Double directly into the Mode.
31
32 class ( IArray (ADArray s) e
33 , MArray (ADSTArray s s') e (ST s')
34 , MArray (ADIOArray s) e IO
35 , Lifted s) => LiftedArray s e where
36
37 type ADArr s e :: * -> * -> *
38 type ADSTArr s e :: * -> * -> *
39 type ADIOArr s e :: * -> * -> *
4e83a16 @ekmett repository initialized. multiple modes of automatic differentiation c…
authored
40
927ffc2 @ekmett TODO
authored
41 newtype ADArray s i e = ADArray (ADArr s e i e)
4e83a16 @ekmett repository initialized. multiple modes of automatic differentiation c…
authored
42
927ffc2 @ekmett TODO
authored
43 class ( LiftedArray s Float, LiftedArray s Double, ...) => Mode s
Something went wrong with that request. Please try again.