Skip to content

Commit 58fa014

Browse files
authored
Document single output (#53)
* Document single output * Better titles
1 parent cf5ab9d commit 58fa014

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

docs/src/faq.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
# Frequently Asked Questions
22

3+
## Supported autodiff backends
4+
5+
- Forward mode: [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl)
6+
- Reverse mode: all the packages compatible with [ChainRules.jl](https://github.com/JuliaDiff/ChainRules.jl)
7+
8+
In the future, we would like to add [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) support.
9+
310
## Higher-dimensional arrays
411

5-
For simplicity, the examples only display functions that work on vectors.
6-
However, arbitrary array sizes are supported.
12+
For simplicity, our examples only display functions that eat and spit out vectors.
13+
However, arbitrary array shapes are supported, as long as the forward _and_ conditions callables return similar arrays.
714
Beware however, sparse arrays will be densified in the differentiation process.
815

16+
## Scalar input / output
17+
18+
Functions that eat or spit out a single number are not supported.
19+
The forward _and_ conditions callables need arrays: for example, instead of returning `value` you should return `[value]` (a 1-element `Vector`).
20+
Consider using an `SVector` from [StaticArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl) if you seek increased performance.
21+
922
## Multiple inputs / outputs
1023

1124
In this package, implicit functions can only take a single input array `x` and output a single output array `y` (plus the additional info `z`).
@@ -26,7 +39,7 @@ f(x::ComponentVector) = f(x.a, x.b)
2639

2740
The same trick works for multiple outputs.
2841

29-
## Constrained optimization modeling
42+
## Modeling constrained optimization problems
3043

3144
To express constrained optimization problems as implicit functions, you might need differentiable projections or proximal operators to write the optimality conditions.
3245
See [_Efficient and modular implicit differentiation_](https://arxiv.org/abs/2105.15183) for precise formulations.
@@ -37,10 +50,3 @@ In case these operators are too complicated to code them yourself, here are a fe
3750
- [ProximalOperators.jl](https://github.com/JuliaFirstOrder/ProximalOperators.jl)
3851

3952
An alternative is differentiating through the KKT conditions, which is exactly what [DiffOpt.jl](https://github.com/jump-dev/DiffOpt.jl) does for JuMP models.
40-
41-
## Which autodiff backends are supported?
42-
43-
- Forward mode: ForwardDiff.jl
44-
- Reverse mode: all the packages compatible with [ChainRules.jl](https://github.com/JuliaDiff/ChainRules.jl)
45-
46-
In the future, we would like to add [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) support.

0 commit comments

Comments
 (0)