Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review examples #164

Merged
merged 46 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e5f59b9
add examples
akshay326 May 22, 2021
c219514
dont compile flux code
akshay326 May 23, 2021
d68deb6
remove imgs; fix camelcase
akshay326 Jun 15, 2021
9a85c0c
Update docs/src/autotuning-ridge.md
matbesancon Jun 16, 2021
2340c8c
Update docs/src/sensitivity-analysis-ridge.md
matbesancon Jun 16, 2021
81f2176
fix missing packages
akshay326 Jun 23, 2021
a626a73
Merge branch 'master' into more_examples
akshay326 Jun 26, 2021
8013b48
changes in doc
akshay326 Jun 26, 2021
644e688
add missing files
akshay326 Jun 26, 2021
0230bdf
fix typo
akshay326 Jun 26, 2021
9703d15
Merge branch 'more_examples' of github.com:jump-dev/DiffOpt.jl into m…
matbesancon Jul 1, 2021
23ea11b
Update docs/src/custom-relu.md
matbesancon Jul 4, 2021
cee668a
fix typo
akshay326 Jul 13, 2021
1d56f98
fix typo
akshay326 Jul 13, 2021
5ddee11
minor namechange
akshay326 Jul 14, 2021
cc661c1
Merge branch 'master' into more_examples
akshay326 Jul 14, 2021
2a08db4
fix examples; add them to test
akshay326 Jul 14, 2021
3104919
add missing dependency
akshay326 Jul 14, 2021
2695424
update docs
akshay326 Jul 14, 2021
10f4ac7
add missing dependencies
akshay326 Jul 14, 2021
7d1e3f5
minor changes
akshay326 Jul 14, 2021
c7c35f5
update Project.toml
akshay326 Jul 14, 2021
ca8ff66
add missing dependencies
akshay326 Jul 14, 2021
aef6ac0
fetch data from http
akshay326 Jul 14, 2021
928ad9d
missing pkg in docs
akshay326 Jul 14, 2021
8a19df4
minor fix for julia 1.0
akshay326 Jul 14, 2021
e14babb
Update sensitivity-analysis-svm.md
akshay326 Jul 15, 2021
40adc7f
Update sensitivity-SVM.jl
akshay326 Jul 15, 2021
8d572c6
Merge remote-tracking branch 'origin/master' into more_examples
joaquimg Dec 4, 2021
b2fed5d
update project
joaquimg Dec 4, 2021
c2d8711
Cleanup dependencies of functions
joaquimg Dec 4, 2021
a32dce1
more fixes
joaquimg Dec 5, 2021
26f382d
add jump
joaquimg Dec 5, 2021
c30be4c
fix solver
joaquimg Dec 5, 2021
efe7143
simplfix checks and simplify relu
joaquimg Dec 5, 2021
add7201
automate tutorials inclusion
joaquimg Dec 5, 2021
59e499a
fix comments
joaquimg Dec 5, 2021
1a2a3a6
remove redundant examples
joaquimg Dec 6, 2021
cd02b7b
remove Clp to only use GLPK
joaquimg Dec 6, 2021
9d353a7
cleanup tutorials
joaquimg Dec 6, 2021
06978c0
remove log scale
joaquimg Dec 6, 2021
0497447
fix project
joaquimg Dec 6, 2021
110f522
split plots
joaquimg Dec 6, 2021
46a244f
cleanup badges
joaquimg Dec 6, 2021
5d62b45
improve ridge sensib tutorial
joaquimg Dec 6, 2021
ec9b596
[no ci] Update docs/src/examples/sensitivity-analysis-ridge.jl
joaquimg Dec 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ MathOptSetDistances = "0.1"
julia = "1.6"

[extras]
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
OSQP = "ab2f91bb-94b4-55e3-9ba0-7f65df51de79"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Clp", "DelimitedFiles", "SCS", "OSQP", "GLPK", "Ipopt"]
test = ["Test", "DelimitedFiles", "SCS", "OSQP", "GLPK", "Ipopt", "CSV", "Statistics", "DataFrames", "Flux", "MLDatasets", "Plots", "Printf", "HTTP"]
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@ DiffOpt can be installed via the Julia package manager:

1. Create a model using the wrapper.
```julia
using JuMP, DiffOpt, Clp
using JuMP
import DiffOpt
import GLPK

model = JuMP.Model(() -> diff_optimizer(Clp.Optimizer))
model = JuMP.Model(() -> DiffOpt.diff_optimizer(GLPK.Optimizer))
```

2. Define your model and solve it a single line.
```julia
@variable(model, x)
@constraint(
model,
cons,
model,
cons,
x >= 3,
)
@objective(
model,
Min,
model,
Min,
2x,
)

Expand All @@ -46,8 +48,8 @@ optimize!(model) # solve
```julia
MOI.set.( # set pertubations / gradient inputs
model,
DiffOpt.BackwardInVariablePrimal(),
x,
DiffOpt.BackwardInVariablePrimal(),
x,
1.0,
)
```
Expand All @@ -57,8 +59,8 @@ MOI.set.( # set pertubations / gradient inputs
DiffOpt.backward(model) # differentiate

grad_exp = MOI.get( # -3x+1
model,
DiffOpt.BackwardOutConstraint(),
model,
DiffOpt.BackwardOutConstraint(),
cons
)
JuMP.constant(grad_exp) # 1
Expand Down
10 changes: 8 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
OSQP = "ab2f91bb-94b4-55e3-9ba0-7f65df51de79"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
6 changes: 0 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ end

literate_directory(_EXAMPLE_DIR)


makedocs(;
modules=[DiffOpt],
doctest = false,
Expand All @@ -53,11 +52,6 @@ makedocs(;
"Manual" => "manual.md",
"Usage" => "usage.md",
"Reference" => "reference.md",
"Examples" => [
"Differentiating a simple QP by hand" => "matrix-inversion-manual.md",
"ChainRules integration (Relaxed Unit Commitment)" => "chainrules_unit.md",
"Solving conic with PSD and SOC constraints" => "solve-conic-1.md",
],
"Tutorials" => [
joinpath("examples", f) for f in readdir(_EXAMPLE_DIR) if endswith(f, ".md")
],
Expand Down
282 changes: 0 additions & 282 deletions docs/src/chainrules_unit.md

This file was deleted.

Loading