autodiff
Taylor-expand the solution of an initial value problem (IVP).
forward_mode_recursive(vf: Callable, inits: tuple[Array, ...], /, num: int)
¤
Taylor-expand the solution of an IVP with recursive forward-mode differentiation.
Compilation time
JIT-compiling this function unrolls a loop.
Source code in probdiffeq/taylor/autodiff.py
113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
taylor_mode_doubling(vf: Callable, inits: tuple[Array, ...], /, num_doublings: int)
¤
Combine Taylor-mode differentiation and Newton's doubling.
Warning: highly EXPERIMENTAL feature!
Support for Newton's doubling is highly experimental. There is no guarantee that it works correctly. It might be deleted tomorrow and without any deprecation policy.
Compilation time
JIT-compiling this function unrolls a loop.
Source code in probdiffeq/taylor/autodiff.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
taylor_mode_scan(vf: Callable, inits: tuple[Array, ...], /, num: int)
¤
Taylor-expand the solution of an IVP with Taylor-mode differentiation.
Other than taylor_mode_unroll()
, this function implements the loop via a scan,
which comes at the price of padding the loop variable with zeros as appropriate.
It is expected to compile more quickly than taylor_mode_unroll()
, but may
execute more slowly.
The differences should be small. Consult the benchmarks if performance is critical.
Source code in probdiffeq/taylor/autodiff.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
taylor_mode_unroll(vf: Callable, inits: tuple[Array, ...], /, num: int)
¤
Taylor-expand the solution of an IVP with Taylor-mode differentiation.
Other than taylor_mode_scan()
, this function does not depend on zero-padding
the coefficients at the price of unrolling a loop of length num-1
.
It is expected to compile more slowly than taylor_mode_scan()
,
but execute more quickly.
The differences should be small. Consult the benchmarks if performance is critical.
Compilation time
JIT-compiling this function unrolls a loop.
Source code in probdiffeq/taylor/autodiff.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|