Skip to content

Commit

Permalink
add mlutils docs dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Sep 20, 2024
1 parent fd0d35d commit 454671a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
AmplNLWriter = "7c4d4715-977e-5154-bfe0-e096adeac482"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Expand All @@ -11,6 +12,7 @@ Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856"
Expand All @@ -33,6 +35,8 @@ OptimizationPRIMA = "72f8369c-a2ea-4298-9126-56167ce9cbc2"
OptimizationPolyalgorithms = "500b13db-7e66-49ce-bda4-eed966be6282"
OptimizationSpeedMapping = "3d669222-0d7d-4eb9-8a9f-d8528b0d9b91"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
Expand All @@ -43,6 +47,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
AmplNLWriter = "1"
ComponentArrays = "0.15"
Documenter = "1"
FiniteDiff = ">= 2.8.1"
ForwardDiff = ">= 0.10.19"
Expand All @@ -53,6 +58,7 @@ Juniper = "0.9"
Lux = "1"
Manifolds = "0.9"
Manopt = "0.4"
MLUtils = "0.4.4"
ModelingToolkit = "9"
NLPModels = "0.21"
NLPModelsTest = "0.10"
Expand All @@ -75,6 +81,8 @@ OptimizationPRIMA = "0.3"
OptimizationPolyalgorithms = "0.3"
OptimizationSpeedMapping = "0.3"
OrdinaryDiffEq = "6"
Plots = "1"
Random = "1"
ReverseDiff = ">= 1.9.0"
SciMLBase = "2.30.0"
SciMLSensitivity = "7"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/optimization_packages/optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ res = solve(prob, Optimization.LBFGS(), maxiters = 100)

```@example Sophia
using Optimization, Lux, Zygote, MLUtils, Statistics, Plots
using Optimization, Lux, Zygote, MLUtils, Statistics, Plots, Random, ComponentArrays
x = rand(10000)
y = sin.(x)
Expand Down
7 changes: 4 additions & 3 deletions docs/src/tutorials/minibatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ It is possible to solve an optimization problem with batches using a `MLUtils.Da

```@example minibatch
using Lux, Optimization, OptimizationOptimisers, OrdinaryDiffEq, SciMLSensitivity, MLUtils
using Lux, Optimization, OptimizationOptimisers, OrdinaryDiffEq, SciMLSensitivity, MLUtils,
Random, ComponentArrays
function newtons_cooling(du, u, p, t)
temp = u[1]
Expand Down Expand Up @@ -50,7 +51,7 @@ t = range(tspan[1], tspan[2], length = datasize)
true_prob = ODEProblem(true_sol, u0, tspan)
ode_data = Array(solve(true_prob, Tsit5(), saveat = t))
prob = ODEProblem{false}(dudt_, u0, tspan, pp)
prob = ODEProblem{false}(dudt_, u0, tspan, ps_ca)
function predict_adjoint(fullp, time_batch)
Array(solve(prob, Tsit5(), p = fullp, saveat = time_batch))
Expand All @@ -67,7 +68,7 @@ k = 10
train_loader = MLUtils.DataLoader((ode_data, t), batchsize = k)
numEpochs = 300
l1 = loss_adjoint(pp, train_loader.data)[1]
l1 = loss_adjoint(ps_ca, train_loader.data)[1]
optfun = OptimizationFunction(
loss_adjoint,
Expand Down

0 comments on commit 454671a

Please sign in to comment.